My question is simple and somewhat straight forward. I want to increase or decrease a gameobject’s position based on another gameobject’s rigidbody velocity. Thanks in advance for help !!
In the script, type this code:
public Rigidbody thisRigidbody;
public Rigidbody otherRigidbody;
private void LateUpdate()
{
thisRigidbody.velocity = otherRigidbody.velocity;
}
make sure to assign the rigidbodies, and use “Rigidbody2D” if you’re in a 2D scene.