calculated value in Start() function seems to be 0 when trying to use it.
Hi, i'm an amateur trying to learn c#. I'm confronted with a problem I can't seem to solve:
I'm trying to use the "objectLength" value in the Start() function of my SpawnManager. I calculate "objectSize" in a different script called objectMovement. Now I know that it calculates the value correctly, but when I try to use it in the Start() function it is 0. (My Debug.Log(objectLength) outputs 0.)
It must be a stupid error but I can't solve it.
Thanks for your kind help!
2 Replies
I think your ObjectLength is an object and you need the length property, so maybe something like: ObjectLength.Length;
Well, I took the Vector3 (objectSize) from the object (halfpipeInstance) and then the z value, so that should be correct? Also it‘s not giving me an error that would suggest that..