My videogame is full of planets and the gravity of the player change in order to walk around this planets. My problem is when I arrive at some points of the planet that the player starts to spin althought I only am press the key to move forward.
Here’s a photo of my code rotation. I take the normal of the surface in the position of the player.
I wonder if it is gimbal lock.
If it is you might be able to overcome it by passing your wire that goes to the lerp B pin through a Combine Rotators node first. Combine rotators uses quaternions which avoid gimbal lock when calculating between two rotations.
I call the event Rotate in Event tick directly, and I put the multiplier in delta for rotate more fast. I can remove this multiplier and raise the interpSpeed, but the problem i showed in the gif is still there
I put the nodes like you say, but the it works worse. The player are rotating non-stop all the time. is there any way to know if the problem is really Gimbal Lock?
I found the solution!! The problem was the make rot from Z. I was to put Make rot from ZX and put in the input X the forward verctor of the player. Now works perfectly. Thanks to the people to tried help me.
Not sure, just by watching when an axis reaches 90 or 180 degrees, does it stay stuck there and force the other axes to move differently than normal. That’s one way to detect gimbal lock.