Time.deltaTime * Vector3 = (0,0 ,0) ???
I'm stumped by some odd behavior in Unity (5). When I attempt to adjust a Vector3 by multiplying by Time.deltaTime, it is causing my Vector3 to result in (0.0, 0.0, 0.0).
I can multiply 2 floats:
>> speed: 0.7787994, delta: 0.02, speed * delta: 0.01557599
But, when I multiple the deltaTime * a Vector3, it ALWAYS sets my Vector3 to 0,0,0:
Here is the code:
And some output:
Casting Time.deltaTime to a float did nothing. If I replace Time.deltaTime with a hardcoded float, the Vector multiplication works. This is driving my bonkers. Has anyone dealt with this problem before?
My debugging reports Time.deltaTime as type "System.Single", but I take it this is just the c# representation of a float?
Many thanks to anyone who can help! :)
I can multiply 2 floats:
>> speed: 0.7787994, delta: 0.02, speed * delta: 0.01557599
But, when I multiple the deltaTime * a Vector3, it ALWAYS sets my Vector3 to 0,0,0:
Here is the code:
Debug.Log ("Vector3 before: " + movement);
movement = movement * Time.deltaTime;
Debug.Log ("Vector3 after: " + movement);
And some output:
Vector3 before: (0.5, 0.0, 0.9)
Vector3 before: (0.5, 0.0, 0.8)
Vector3 before: (0.6, 0.0, 0.8)
Vector3 after: (0.0, 0.0, 0.0) (x 100s of these)
Casting Time.deltaTime to a float did nothing. If I replace Time.deltaTime with a hardcoded float, the Vector multiplication works. This is driving my bonkers. Has anyone dealt with this problem before?
My debugging reports Time.deltaTime as type "System.Single", but I take it this is just the c# representation of a float?
Many thanks to anyone who can help! :)
