- Home /
move a transform to a vector 3?
Hi ive been googling around for the past few hours and have not found anything on this (please link me if i missed something) what i want tot do is smoothly move a transform to a vector 3
so i could a have a vector 3 defined and i would place in the point in which i want the object to move to something like transform.postion = the vector 3 i defined. or something similer but using slerp or something similer
just as a side not i need to use vector 3 as having many many gameobjetcs would just clutter things up
is there a way to do this? or are transforms and vectors just too differant?
hi thanks for that i guess i just wasnt looking in the right places. do you want to put that as an answer can ill accept it~?
Answer by maccabbe · May 16, 2015 at 08:10 PM
http://answers.unity3d.com/questions/938559/how-to-move-instantiated-object-to-pre-defined-pos.html
http://www.blueraja.com/blog/404/how-to-use-unity-3ds-linear-interpolation-vector3-lerp-correctly
http://answers.unity3d.com/questions/14288/can-someone-explain-how-using-timedeltatime-as-t-i.html
Answer by CatStormWasTaken · Sep 23, 2021 at 02:22 PM
Sorry, I might be a little bit late. But I want to post anywas for those that dont know how to do this.
public Transform exampleTransform;
public Vector3 exampleVector3;
void Update()
{
exampleVector3 = new Vector3(exampleTransform.position.x, exampleTransform.position.y, exampleTransform.position.z);
}
This allows you to take the xyz positions of the transform and store them in the Vector3.
Your answer
Follow this Question
Related Questions
Moving a Platform 1 Answer
Why using = isn´t fast enough for changing Vector3 values from the transform? 2 Answers
Player rotation = Camera Rotation 0 Answers
nullifying targetObject after a Smooth LookAt Transition 2 Answers
How would I rotate an object relative to another without parenting? 2 Answers