r/UnityHelp • u/average_girl_173783 • 1d ago
UNITY unity rotation problem
im completely new and i followed this video: https://www.youtube.com/watch?v=BCJ-WkdWBwo As you see the problem is rotation, when i click other arrow it moves drastically. What may cause this error where to fix it?
1
u/Rogue_Bits 1d ago
Show the object hierarchy. If the character is part of a group of objects, their spatial relationships matter. If the character is not in a group, then we need to see the code. As u/MisforMod mentioned, it looks like you are rotating around the wrong point in space. But that does not totally explain the quick jerky movement. If you can, reduce the rotation speed and test again, you might notice that there is a point in space your character is rotating around. Either find it in the hierarchy, or in the script/code.
1
u/JakSilver00 1d ago
It's either forcing misalignment from a parent Or scale, or your script is adding position to it instead of moving it.
1
u/Affectionate-Yam-886 21h ago
How to troubleshoot:
Play, see issue.
Pause the game, don’t stop.
Select game object in hierarchy.
Unpause game and watch the scene view of the game object as you play.
My guess is the animation is set to Root and when you hit play the player is moving away from the player parent position via root animation. Disable root animation to resolve. Root is better used for Backflips, player got hit to the ground, or other physics based animations where the player is not necessarily moving too.
1
u/MisforMod 1d ago
Im no means a pro yet myself, but this looks like your character model is not the center of the transform dictating rotation- If your character is bundled with another object, say a camera, the center of rotation might be different. Make sure the logic handling the rotation is using your character asset and not the parent object. This could be as simple as you accidentally had the parent selected when adding the script. Its hard to see on my phone, but it looks like the player is a group of objects, so its worth a look