- Home /
Position in Vector (C#)
Hey,
I am trying to store a position in a vector3. I was able to do it in JS:
var movementThisStep : Vector3 = myRigidbody.position - previousPosition;
But when I try to do it in C#, I get an error message. I have tried to do it this way:
Vector3 movementThisStep = new Vector3 (myRigidbody.position - previousPosition);
And got this error message: The type `UnityEngine.Vector3' does not contain a constructor that takes `1' arguments
Comment
Hi Akos,
Have you tried:
Vector3 movementThisStep = (myRigidbody.position - previousPosition);
Cheers!
$$anonymous$$ithos
$$anonymous$$ithos has the answer. Someone please convert it.
Best Answer
Answer by MithosAnnar · Sep 22, 2012 at 06:00 PM
Hi Akos,
Have you tried:
Vector3 movementThisStep = (myRigidbody.position - previousPosition);
Cheers!
Mithos