hi,
i wonder why my object not moveing to the click location.
the usage of resetpath make trouble.
it is integrated in move to object and move to position.
i made a screen video: Screen Video at Youtube
Thanks for the video and information.
The reason why ResetPath exists there is that if the action is stopped before completion (interrupted), it also resets the path, thus interrupting pathfinding as well.
The problem here is due to having an inbetween state for the tweening and because that state takes some time to complete.
Have you tried putting both “Tween Position” and “GoTo” actions in the same state directly under the AnyState transition? Or is this something you dont want to do for some reason?
@Gavalakis
hi,
i think i found why it stops
this condition with remainingDistance have wrong values
its 0 before going what will stop direct, also if me will moving a 2 units distance.
my test was stoppingDistance =0,keepDistance is 0.1
so remainingDistance =2 <= stoppingDistance + keepDistance 0+0.1 can’t be true
try this row with remainingDistance>0, so the distance must calculated once after it was 0.
if (agent.pathPending)
{
//wait
} else {
Debug.Log(agent.remainingDistance);
I’m sorry 🙁 It is a bit hard to understand what is your suggested solution/fix in your post. Is it changing the check to this: if (agent.remainingDistance>=0f && agent.remainingDistance <= agent.stoppingDistance + keepDistance)?
If not, can you please rephrase your solution?
Thanks in advance.
i think for one cycle the remainingDistance stay at 0 and is not calculated.
maybe its a sideeffect from resetpath usage.
at !agent.pathPending i expect a Distance in remainingDistance
Author
Posts
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.
Login
Register
By registering on this website you agree to our Privacy Policy.