What is the result of adding transform.position and transform.right?
Hi all,
I know that transform.position is the position of the gameobject in world space and transform.right is the x-axis in world space. Can someone please tell me what you get by adding: transform.position + transform.right?
transform.right is the x-axis
This may be true from default starting point but actually Vector3.right is world space x axis and transform.right is local x axis to the object.
Thanks for the help guys. From your clues with the difference between transform.right and Vector3.right, I think I understand it now. Here's a pic to illustrate my understanding. Please let me know if it is correct.
Answer by mikelortega · Dec 02, 2015 at 12:21 PM
You get the new world position after moving transform.position one unit to the right (on it's own reference system).
Given that the OP is confused about what Transform.right is, I think a full answer would need to cover that point ie explain the difference between Vector3.right and transform.right and what the result is of adding each of them to transform.position.
But simply showing how to add Vector3.right to another vector, with no explanation, does not seem all that helpful.
Your answer
Follow this Question
Related Questions
Error in script? 0 Answers
Problems making something happen local c# 1 Answer
Prefab Enemy2 to track all prefab Enemy1's Instantiates transforms: How? 1 Answer
SImple, but how do I check a game object's position in an If statement? 1 Answer
How to prevent object from entering other colliders 1 Answer