hi guys, just wanted some advice and help on a small issue.
okay so lets say i have a static mesh, and have rotations on it using axis mappings, and rotations occur on the Y axis with the front of the mesh facing X as forward, and example pressing T would let it rotate upwards and G would let it rotate downwards
why is it that when i turn the mesh example X now faces the rear of the mesh ,the rotations are now vice versa, where T would usually be to rotate upwards, but now rotates downwards and the same with the G key???
the meshes local orientation is the same as the worlds orientation, so the meshes x and y is the same as the worlds x and y, the issue is, lets say you add relative rotation to the cube and it would rotate on the y axis, check which way it rotates when key is pressed, then rotate the cube 180 on the z axis, and press play and key to rotate, you will see rotation is now vice versa
Local rotation is local, no matter what, the above is the correct / expected behaviour. If you’re getting something different, there may be other factors we do not know about. Hence me asking for the setup / script upfront. Perhaps you could find a way to clarify some more?
so my axis mapping uses the key T to rotate, and in the video u can see the 1st time when pressing T the thing rotates anti clockwise, but when rotating it 180 degrees and then pressing T it now rotates clockwise, which is vice versa
You’re setting rotation, rather than adding to it. It’s a classic gimbal lock then, I think. Also, not sure how combining world rotation with relative is supposed to work here.
You are rotating the static mesh relative to the default scene root. In the video you rotated the default scene root 180 degrees, causing the static meshes relative axis to be reversed. If you click on the static mesh in the details panel you can change the relative rotation of the mesh instead of the scene roots world rotation.
the only way i could get the rotation to work is to get world rotation and then setting rotation of mesh, i used set rotation because i wanted to limit rotation, and couldnt find a way to limit rotation using add rotation.
I don’t think so, you can see the default scene root and it is highlighted in the video when you flip the rotation 180 degrees. If you were rotating the static meshes X or Z it would be set to zero by the set relative rotation node as soon as it fired anyway. Picture a clock, button 1 advances time button 2 reverses time, now spin this clock around 180 degrees on its Z. Button 1 will still advance time but because the whole clock was flipped its rotating counter clockwise. I think thats kinda like what is going on, but rotation stuff gets confusing. Dunno what the fix would be, what you trying to do, or why there is a scene root for the mesh to rotate relative to.
If you set the Z value of the make rotator node to 180 it should get flipped around and your inputs will still work how you want them to.
But even in my other project it does the same, this was just an example when using that code, if ever i just use a add rotation without all the rest of the BP its normal, rotation is normal, but something about this specific BP causes this, I’ll upload a video of the other project, and you’ll see same thing happens, so i don’t know whats the issue with thi specific BP
The get world rotation and combine rotator nodes are where you are flipping the axis over, it is the value of Z in get world rotation. When you rotate the whole object 180 degrees on its Z axis it is going to change the static meshes world rotation to 180 degrees as well. This flips over the relative axis when you combine the rotations. You could split it open and don’t combine the Z rotation, or use get relative rotation instead of world and it shouldn’t flip the axis.