- Home /
Why does transform.position.Set() exist?
You can only set position by using transform.position = new Vector3() so why does the position.Set() function exist?
Set() is not a property of "position" it is a property of Vector3:
http://docs.unity3d.com/Documentation/ScriptReference/Vector3.Set.html
Answer by aldonaletto · Nov 14, 2012 at 01:16 AM
Set() is applicable to Vector3 variables, but position isn't actually a variable (despite what the docs say...): it's a property, which is set or read by internal functions known as setter and getter. Many things that you can do with an actual Vector3 variable aren't possible with a Vector3 property - you can't modify only the X coordinate of a Vector3 property in C#, for instance.
Your answer
![](https://koobas.hobune.stream/wayback/20220613083827im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Set the position of a transform object 1 Answer
Camera rotation around player while following. 6 Answers
Issue's With Positioning 0 Answers