using UnityEngine;
using System.Collections;
public class GoalOne : MonoBehaviour {
public GameObject ball;
void OnTriggerEnter(Collider other)
{
if(other.gameObject.layer == LayerMask.NameToLayer("Water"))
{
Debug.Log (other.gameObject.layer);
if(ball != null){
ball.GetComponent<Transform>().position =new Vector3(0,2f,0);
}
}
}
No comments:
Post a Comment