- Home /
Question by
The-Gaming-Seed · Dec 16, 2016 at 08:41 AM ·
c#vector3navmeshtransform.position
Nav Mesh and transform.position failure!
Hello, i'm experiencing an extremely annoying problem with the Nav Mesh with the transform.position element.
here you see the map
The ball goes to the red pad using the Nav Mesh agent. The problem is that when it goes to the trigger it doesn't go beyond the wall. I wish i could show you an example.
Transform.position code:
public GameObject Ball;
public Vector3 Location = new Vector3 (1, 1, 1);
void OnTriggerEnter(Collider other)
{
if (other.CompareTag ("Player"))
{
Ball.transform.position = Location;
}
}
and the nav mesh agent code:
{ NavMeshAgent Agent; Rigidbody rb; public Transform Movement_Target;
void Start()
{
Agent = GetComponent<NavMeshAgent> ();
rb = GetComponent<Rigidbody> ();
}
void Update()
{
Agent.SetDestination (Movement_Target.position);
}
I've assigned everything but nothing works please help is needed!!!!
edit:
The ball is meant to go back to the black pad when it goes into the red pad
screenshot-2016-12-15-205815.png
(185.8 kB)
Comment