Ok, I know how this sounds, but it isn’t like that :D. I know there’s many questions regarding this, but I believe my problem is a bit different and after working for hours my brain is fried, hence resists to my attempts of programming. I have a character, with this hierarchy
- Character
- Visual mesh
It’s a top-down shooter, so the character is contrantly spinning around, trying to look at the mouse, which makes the visual mesh spin too. Now, normally, I’d use
VisualMesh.localRotation = Quaternion.FromToRotation(VisualMesh.up, hit.normal);
But this doesn’t work, because as soon as I rotate the character around, it stops being aligned.
So, my question is, how would I go about aligning the visual object with the ground, while making it keep it’s parents Y rotation.
Pictures
Character’s y rotation set to 0
Character’s y rotation set to 180
–David