+= operator on transform.localPosition results in random values
Whenever I add (or subtract) any vector to the local position, the resulting localPosition isn't anywhere close to the sum of the two. See the images below for localPosition's value as I step through the operation:
<0, -.25, 0> + <0, 0, 0> = <0, -.5, 0>
<11.535, 11.535, 0> + <1, 1, 1> = <2.000005, -1, 1.000003>
WTF could possibly be causing this, and how do I fix it?
Answer by solidDoWant · Dec 10, 2017 at 04:46 AM
Asked on discord, nobody could figure out the cause. Found a workaround by making a public method in the x's type that did the exact same thing. No issue.
Your answer
![](https://koobas.hobune.stream/wayback/20220612144248im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Need help getting randomly moving particles to head to the nearest of 4 coordinates. 1 Answer
How to change rotation for a FirstPersonController through script. 0 Answers
Moving GameObject a specific distance in the Z direction and back again - regardless of rotation 1 Answer
Set variable to position of collided object. 0 Answers
I got Some Error about how to Transform Postiton Enemy where one point can spawn 2 enemies. 1 Answer