playMaker

Author Topic: Detecting a Rotation  (Read 1579 times)

MajorIdea

  • Full Member
  • ***
  • Posts: 131
Detecting a Rotation
« on: July 17, 2017, 01:30:24 PM »
I'm trying to make it so when a boat turns at speed it sends particles in the opposite direction of the turn (the water being pushed) - if turning to the left, it should enable the right particle system.


What I can't figure out is how to detect the boat's rotation to choose which side the particles should emit out of.

I've tried to do it by detecting the velocity vector, the rotation but I'm at a loss at how to do this.

Any pointers would be greatly appreciated!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Detecting a Rotation
« Reply #1 on: July 17, 2017, 02:22:59 PM »
Hi,
How is the boat turned the boat (controller pressing left/right, touch, Ai) ?

MajorIdea

  • Full Member
  • ***
  • Posts: 131
Re: Detecting a Rotation
« Reply #2 on: July 17, 2017, 02:38:30 PM »
Oh right! It's a top-down game and it's using input axis (Rewired so controller and wasd) and an add force.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Detecting a Rotation
« Reply #3 on: July 18, 2017, 01:59:49 AM »
Hi,
Maybe you can determine which way you are going with the axis (cheap way)

or you can use 'get rotation' store 'X Angle' in 'last location' then use 'Next Frame Event'
Then use 'get rotation' again and store 'X Angle' in 'Current Location' then use float compare
then set an event for each event (greater,less,equal)
and do what you need to do for each direction.

then loop back to 1st state.