For some reason when the units are moving they get stuck and collide at the edge of my concentric circle. When i click once and do nothing they clump up and never continue to the navmesh destination set from the info below…why do they stop and not continue to the location…if i put MovePlayerToDestination in update it works but obviously that would not be the way to do things. From my understanding both .SetDestination & .destination = should keep going until they have reached their destination why do they stop??? ulgh frustrating problem…
[41094-badbug.jpg*_|41094]
void MoveToMouse()
{
Plane plane = new Plane (Vector3.up, transform.position);
rayToMouse = Camera.main.ScreenPointToRay (Input.mousePosition);
float dist;
plane.Raycast (rayToMouse, out dist);
if (Physics.Raycast(rayToMouse, out hitTag))
{
//need owner check before interacting with planet options
//if (hit.transform.tag != "Planet")
MarkerGO.transform.position = hitTag.point;
}
MovePlayerToDestination();
}
public void MovePlayerToDestination()
{
for (int i = 0; i < GlobalLimit; i++)
{
if (PlayerUnitCache _!= null && PlayerUnitCache*.activeSelf)*_
* {*
* if (MarkerUnits.Count > 1)*
* CreateConcentricCircles(i+1);*
if (PlayerUnitCache_.transform.position != MarkerUnits*.transform.position)
{
if (MarkerUnits.Count > 1)
{
MarkerUnits.transform.position = new Vector3(pos.x+MarkerGO.transform.position.x, 0.012f, pos.y+MarkerGO.transform.position.z);
}
else if (MarkerUnits.Count == 1)
{
MarkerUnits.transform.position = MarkerGO.transform.position;
}
//SetDestination stops if something is blocking the path.
PlayerAgentCache.destination = MarkerUnits.transform.position;
}
}
}
}*_
* // Update is called once per frame*
* void Update ()*
* {*
* if (Input.GetMouseButton(0) && !RTSCamera.dragging)*
* {*
* Invoke(“MoveToMouse”, 0.12f);*
* }*
* else if(RTSCamera.dragging)*
* CancelInvoke(“MoveToMouse”);*
* }*
_*