- Home /
object ai following, idle animation and pathfinding
To the moderator dont close this question for asking help or code or anything off topic. i want to see if anyone can help me
hi, i have a player and a floating gameobject(something like a flying gadget). well, i also made an animation for the gadget, the animation is simple, in the animation it just fly to a door, to help the player find way to the next round. there is 2 animation. idle(just stay still with a little motion to make it looks loke it is flying) pathfinding(where the gadget help to find the door)
so here is my question, when my gadget is going too far(with pathfinding animation) and the player is unable to catch with it, i want to make that animation pause and play the idle animation. and when the player is near it will resume the pathfinding animation, maybe adding a collider to the gadget so if the player collide it will stop the idle anim and resume the pathfinding animation.
so how do i do that?? i mean swithing the animation without stop the pathfinding animation(only pause until the player is able to catch up)?
Answer by killer-zog · Jun 26, 2013 at 05:12 PM
well instead of using animation i searched a bit and got it with itween path. i am closing this thread thanx for help
Answer by darthbator · Jun 26, 2013 at 12:39 AM
make a bool in update. Only move the object when the bool is in x state (true/false whatever). Then use something like Vect3.dist to monitor the players distance from the goal object. If it's greater then you want stop the animation. If not play the animation. There are better ways to do this sort of thing but that is the fix as you asked for it.
Your answer
Follow this Question
Related Questions
Problems with pathfinding algorithm 0 Answers
How to run 1 animation, then other 2 Answers
How to save a destination on a variable from NavMesh clicking 1 Answer
Follow animation position 2 Answers