Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: frogwise on May 22, 2018, 10:33:31 PM

Title: Making a character in a boat row left or right depending on direction of navmesh
Post by: frogwise on May 22, 2018, 10:33:31 PM
I have a little character in a rowboat. The game is a simple click-to-move game using a NavMesh agent for the boat.

If I make 3 animations:

1. row left
2. row right
3. row both

Could I set it up so that when the boat is rotating right, the row left animation is playing, when rotating left, the row right animation is playing, and when moving forward, the row both animation is playing?

Thanks in advance!
Title: Re: Making a character in a boat row left or right depending on direction of navmesh
Post by: jeanfabre on May 23, 2018, 02:10:58 AM
Hi,

I would try the following:

- compare the direction of your boat with its last direction, and this will let you know which animation to play based on the signed angle between the two.

- use GetGameObjectSpeed action from the Ecosystem, the speed is a vector an thus gives you the current direction too
- use the GetSignedAngleToTarget action from the Ecosystem


Let me know how you progress on this.

 Bye,

 Jean