playMaker

Author Topic: Help with player rotation issue  (Read 1453 times)

paradiseprime

  • Full Member
  • ***
  • Posts: 106
Help with player rotation issue
« on: January 20, 2023, 12:34:52 AM »
I am trying to replicate this type of rotation. https://streamable.com/2ywmv0

Currently I get the angle between the 2 players and compare them to a value. if larger than that value, I tween the float for the X axis but the source is completely smooth with no signs of switching angles.

Just using Look At along gives me a very close result when I use 1,1,0 as the Up Vector but when across from each other, they tilt. It looks completely fine when they are above each other and vice versa when I use 0,1,0.

Any ideas would be great. I've been stuck on this for a while.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Help with player rotation issue
« Reply #1 on: January 20, 2023, 02:05:26 AM »
Hi
Parenting might be the key here.

It look like there is a center point between the 2 and.

Have 1 parent for positioning then a child for rotate x and another child to rotate y then the enemies as child of that

paradiseprime

  • Full Member
  • ***
  • Posts: 106
Re: Help with player rotation issue
« Reply #2 on: January 20, 2023, 11:10:54 AM »
Hi
Parenting might be the key here.

It look like there is a center point between the 2 and.

Have 1 parent for positioning then a child for rotate x and another child to rotate y then the enemies as child of that

Thank you for response. I dont quite understand what you mean by having the child rotate X and another Y. 

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Help with player rotation issue
« Reply #3 on: January 22, 2023, 12:03:45 PM »
Hi.
Tree like this :

Main Parent  (does movement x / y )
        Child 1 does rotation x direction
               Child 2 does rotation y y direction
                      Enemy 1
                      Enemy 2