- Home /
Transformations
transform.back and tranform.left don't seem to work in transformations. Why?
Why not just make your own transform variables?
Vector3 fwd = transform.TransformDirection(Vector3.forward);
Vector3 back = transform.TransformDirection(Vector3.back);
Vector3 left = transform.TransformDirection(Vector3.left);
Vector3 right = transform.TransformDirection(Vector3.right);
Then you could just call fwd, left, back, right...
You don't need TransformDirection(Vector3.forward), just use transform.forward. You could do "back = -transform.forward", however that would remain a fixed value whereas the actual transform.back will change depending on the orientation of the object, so unless you're using that variable a lot right away I'd say it's not really worth defining it. -transform.forward is pretty clear.
Thanks, but I already knew that :P transform.forward is just easier to type than all of that
Well you asked the question, we're trying to offer you solutions lol. No problem.
Answer by Eric5h5 · Dec 15, 2012 at 12:52 AM
If something is not in the docs--which back, left, and down are not--then it either doesn't exist or you probably shouldn't use it (since undocumented features are subject to change).
Answer by DaveA · Dec 14, 2012 at 11:26 PM
tranform.down won't work either. Use -transform.up, -transform.right, -transform.forward