Lock rotation on Z-axis
Hi!
I have a space ship which rotates only on x when I press D-pad left /right buttons. But when the ship is on the ground, and I rotates the ship, the ship falls forward on the Z-axis. Is it a way to avoid that? Or even if I crash the ship a lot on obstacles, it will also slowly rotate forward on Z-axis. It bothers me a lot. What can I do?
-
Hi,
Unfortunately there's currently no way to make the collisions behave in a 2D way so you'll need to work around it. The best option is probably to use a look-at rotator to rotate the ship. You can use the stay upright option to prevent rolling around the z-axis. You'll probably also want to add a mover of some sort on the ship to make it move back to the correct z plane after a collision.
Hope that helps
Matt -
Hi!
Thank you for the answer.
It seems like it works with "Look At Rotator"
Maybe it can be useful for other people also.
I placed a tag on the scene. It's very important to not place it in the same position as the player on the Z-axis, or else it will not work.
Rotate the pointer on the rotator so it's pointing towards the tag.
Set stength in x and y to 0. And z to max. Set rotation strength to max and overall damping to max. And of course use the same name as the tag. ?
Hope I explained good enough. ?
댓글을 남기려면 로그인하세요.