Does anyone here know how to define vector(x,y,z) axis while doing scripting?
let say i would like my game object to move forward from vector( 0,28,-18 ) position to a specific vector(0,28,52) position, am i able to hardcode it using scripting?
Thanks in advance.
:roll:
I wanted to move an object like you did after clicking a button so this is what I did.
var foo = GameObject.Find(“YourObject”);
foo.transform.position = Vector3(0, 28, 52);
In case you also want to rotate it as well add the following to the code above:
foo.transform.rotation = Quaternion.identity;
foo.transform.Rotate(0.0, 0.0, 0.0);//Replace the 0.0 with your desired numbers.