I am trying to create a door script. I have three door wings. The upper one is working fine, the ones on the side not. They are moving in the wrong direction:
tranform.right , transform.forward , tranform.up represent the direction of a certain object in world space , (aka the red , blue , green arrows in Local mode in scene view)
I’m at position A compared to my parent , and i want to move X units to the right from the perspective of the world (as if i was placed directly in the scene as root object)
It just doesn’t make sense (at least without converting from one space to another) , you’re mixing points from different spaces (local and world).
That red arrow in local space is simply (1,0,0) aka Vector3.right , think about it , no matter how you turn IRL, you’re right hand is on your right , it’s local to you.
So since you’re doing your movement in local space , just change this to
Ok, that works, I am surprised, that brackets have such an impact here. I mean, the multiplication is done at first anyway, so why are them even important? But good to know. Thank you