Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

I can't set the rotation of an object, either with scripts or directly in the editor.

$
0
0
I'm running into a strange issue - I have two directional lights, whose rotations I'm attempting to set in a script (C#) I've created a transform Array which the two lights are assigned to. I've also created a new Vector 3 to store my rotation. (private Vector3 lightVector = (180, 270, 180); When trying to set the rotation using the vector (light[0].transform.localEulerAngles = lightVector, and light[1].transform.localEulerAngles = lightVector) one of the two lights is set correctly. The other light ends up rotated to (-5.0089e-06, 90.00001, 5.00897e-06) And - even stranger, when I end the game and return to the editor, the rotation of the problematic light ends up set to some arbitrary numbers (0, 90, 0) rather than the numbers I set initially inside of the editor. Whats going on here?

Viewing all articles
Browse latest Browse all 171066

Trending Articles