I've got a script that will make a plane rotate and translate when pressing left or right. The problem is that every time the plane moves, it translates relative to the angle after the rotation, instead of relative to the world. Is there a way I can alter the rotation without affecting the tilt of the axes, or translate the object relative to the parent's position? I've attached screenshots of the current behavior, along with my movement code. Any help is appreciated, thanks!
transform.Translate and transform.Rotate can take a Transform to which it should perform the translation/rotation relative to http://www.otee.dk/Documentation/ScriptReference/Transform.html#Translate Code (csharp): transform.Translate(Vector3.forward, transform.parent);
Thanks Joachim! I'll try it out tonight. Edit: it works like a charm! Now I'm curious what else you can make the transform relative to. Obviously Space.World and transform.Parent, but can you do weirder things like make a translation relative to another object's rotation? I don't know why I would want to do this, but it seems like an interesting idea.