playMaker

Author Topic: Making a character in a boat row left or right depending on direction of navmesh  (Read 521 times)

frogwise

  • Playmaker Newbie
  • *
  • Posts: 45
    • View Profile
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!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15376
  • Official Playmaker Support
    • View Profile
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