playMaker

Author Topic: Rotate Player Body within Camera Movement  (Read 1396 times)

Devistute

  • Playmaker Newbie
  • *
  • Posts: 8
Rotate Player Body within Camera Movement
« on: November 13, 2017, 10:37:29 AM »
*Rewrote the whole question for better understanding.

So i have PlayMaker FSM script placed on Camera, that has the basic "Mouse Look" script and "Look At" for the head of my character to follow the camera movement. [Useful with when Player see he's shadow]

The second FSM i have is for Player's Body, but that one is not important with this case, it works as it should. [Also handles movement.]

My actual problem here is to somehow inform the Player Body itself, to rotate with the camera only when the "Mouse Look" Maximum X, and Minimum X is reached. And obviously stop rotating when the those values are not reached.
I haven't found an way to try this for example with variables.

Its funny that i got almost everything in order, from running to jumping and complete Diagonal Movement, but cant get the character to rotate with the Camera Movement  ;D
« Last Edit: November 13, 2017, 02:52:55 PM by Devis »
My game, "The Reminiscence" which uses playMaker almost in all interaction the game offers!

http://www.indiedb.com/games/the-reminiscence

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Rotate Player Body within Camera Movement
« Reply #1 on: November 13, 2017, 06:55:20 PM »
Hi,
I cant test right now, but maybe try something like this :
use 'get rotation' (x) and space probably to 'self' and use some float compares.
Set the values to check, just a little higher/lower than the minimum/maximum X (or look what the rotation position values are when hitting the minimum/maximum values).
If max is reached go to next state.
in that state you should then use a 'compare float'
If it is not max anymore to go back to the first state.

Also in that state you can rotate your body, or set a bool on another fsm or something else to tell the body to move.

Same goes for is Min is reached.