- Home /
object follow other object HELP!!
How do i make an object have the same exact position as an other object's position.But NOT rotation, so im guessing that parenting an object wont work.
Answer by OutRage_Studios · Jan 25, 2012 at 09:44 PM
If the object you wish to have no rotation has a Rigidbody applied just limit the rotation contraraints on the axis you require
No problem, if you have any more troubles with it just get back to me
Answer by syclamoth · Jan 26, 2012 at 01:10 AM
Simplest way is to just use a script which makes your object always follow the position of another object. You don't need a rigidbody or a joint of any kind, just this script:
var target : Transform;
function LateUpdate()
{
transform.position = target.position;
}
What does LateUpdate do?? Whats the difference between that and a normal Update??
LateUpdate updates after all the Updates have been run. The reason I'm using it here is because the assumption is that the 'target' will be moving in Update- this guarantees that the follow position won't lag behind a frame.