Our team has Been working on and off this past year to figure a way around a rotation related issue we have been having.
Now that our game has some major progress, this limitation it really starting to hold us back from finishing up a few important features for our game.
Anyways, We need to get Rotational data from XY&Z from 0 to360 and or beyond 360 without the data jumping all over the place. Need it to drive the sprite animation system based on the rotation of an actor, We have 360 degrees worth of angles rendered out to a sprite sheet. Everything works so far with the Sprite system. However, the Rotation Values are jumping all over the place. One example: We need to locally rotate Z to 45 degrees, Y to 250 degrees, and X to 300 degrees, each needs to give out that exact number of the rotation even when combined like above so we can use that to select the correct Animation frame based on the model’s rotation for the 360 degree Sphere rendered Sprite system. Not just that but we also need to drive mesh to mesh rotation values but lock out specific Axis.
To better explain what limits im hitting here and to help visualize… Make an actor BP
and lets do this:
*add a mesh inside that BP.
*get the mesh or the root of the actor.
*get the world rotation.
*split the pins so we get X,Y, and Z.
*Round each of the Values so that its less confusing.
*print string for each of the rounded X,Y,and Z so that when we run the game the data is at your disposal.
Now lets go into the Editor,
Place the new BP actor in the level, and don’t fire up the game yet, but grab the Rotation gizmos directly in the viewport and rotate them, notice how the data displays next to the Gizmo goes from 0 to 360 and beyond? This is the data that we need to be able to grab inside the BP or C++. ( don’t look at the Details panel data btw)
Ok now!
fire up the game in viewport mode, press F8 and lets grab and rotate the Y axis on the positive rotation,
We will see some funky results which first start when reaching every 90 degrees.
Here’s a break down of what i see happening as i spin a mesh 360 degrees:
At 0 to 90 degrees: that works ok ( X: 0) (Y:0 to 90 as we spin) (Z= 0)
At: 90 to 180 degrees: (X= -180) (Y getting: 90 to and back to 0 as we spin) (Z= -180)
At 180 to 270 degrees: (X= -180,) (Y is getting 0 to -90 as we spin) (Z= -180)
At 270 to 360 degrees: (X= 0) (Y is getting -90 to 0 as we spin) (Z = 0)
The thing is that i need to have a consecutive numbers feed back from Y axis 0 up to 360.
I can’t use X or Z because they are feeding other parameters (For example i can spin 0 to 360 on each X and Z and they are not jumping around),
So my question: Is there a way to cheat around the Y axis issue or some kind of solution i can use to translate above outlined issue into consecutive degrees digits for Y axis ?
Here is one failed attempt to get the Y Axis to go from 0 to 360:
Its failed because the X and Z values still interact with the Y Axis.
Anyways! Having the rotation data correctly display 0 to 360 and Beyond and be divided for each axis is something that we really need for our project so that each axis does not interfere with other axis.