Announcement

Collapse
No announcement yet.

Rotating full 360 on pitch using axis input

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Rotating full 360 on pitch using axis input

    Hopefully a simple solution that I just am over thinking.

    Problem: Have a component in the player pawn which rotates using its pitch based on axis input. When pitch value (float) reaches 90, the axis input remains positive but the rotation value attempts to do lower in value (89), causing the value to get stuck in a loop at 90.
    e.g. press "up" adding axis value of 1 to world location pitch. world location = 90 + 1 = attempts to become 89. 89 + 1 = 90.
    the same happens when using a negative axis input "down". -90 -1 = world rotation becomes -89


    Why is the engine trying to go negative at 90 instead of at 180? Why does the same exact set up work for the separate axis inputs I have set up for lateral movements along the yaw rotation?

    The values never go above 95 and never below -95 - unlike the yaw values which go from 0 to 180 to -180 to 0.

    how can I get around this lock?

    I've attempted to add the pitch value to 360 then use (%360), which returns as though it is using a 0-360 scale, but I still experience a lock when the component rotates to its "poles".

    Any help would be greatly appreciated.
    I'm confused and could really use help.

    #2
    Solved the issue myself- well found out that it seems to be a well known bug that I guess is just being ignored?
    The solution seemed to be adding the axis value directly to the local rotation.
    Not sure if it is a perfect fix, but it is working for now.

    Comment

    Working...
    X