I have 2 game objects, “A” and “B” for example. (Arb is the “A” rigidbody component) I’d like to move A in B.transform.position with rb.MovePosition (so if the objects collides it will stop or something). But with
Arb.MovePosition (B.transform.position);
it teleports. I’d like a Vector3.Lerp but with a rigidbody.
Any tips ?
Thanks for the help.
1 Answer
1As you can see from the link below the question has already been answered
Basically you get the normalized direcion from your object to the target and you move your object along this direction with a given speed, which is multipied to Time.deltaTime to get m/s instead of m/frame
Also be sure to select a proper interpolation method for your rigidbody, otherwise you are going to get strange jittering
Hope this helps
welp i just solved the issue while replying to this i for got to set my bool i have set for loading levels back to false which resulted in the deleted objects cause the level was repeatedly reloading over and over since its on a update . guess ill make function for that and call the function instead ^^ .. thanks
– Wtyson