New to PlayMaker and after an afternoon of searching for a solution, the nob needs help!
In a 3D scene I have a horse enclosure with a few objects in it, a fence and the horse. All of the objects have mesh colliders on them. I created an empty game object, called it HorseFSM and made it a child of the horse object.
My FSM has 6 states in it (see picture below).
- Radar - Check if the player is within a range threshold. If he isn't just loop until he is.
- Random Position - Player is in range so start animation. Get the horse position, generate random X and Z numbers, add them to current position and create a new Vector3.
- Create Waypoint - Create a game object that has it's position as the Vector3 just created.
- Move to Waypoint - I do a smooth look at, play the horse walking animation and do a move towards with a finish event specified (Done Moving)
- Random Delay - Once I'm done moving, I stop the animation, play the idle animation and wait between 5 and 15 seconds.
- Delete Waypoint - I delete the waypoint that's no longer needed and on the finish event, loop back to the Radar state.
This works create with the exception of walking thru walls and the fences.
I've tried putting a box collider on the horse or a rigidbody but just can't seem to figure this out.
Any help would be appreciated.
Thanks,
-Claude.