So I have a Payload which is a rigidbody and which is moving with rigidbody.moveposition. And the player is user controlled trying to protect it. Whenever the player collides with it, i don’t want the player to push it away or go through it. The payload should keep moving on the designated path. I am setting the velocity and angular velocity of the payload to zero in FixedUpdate and also I have set the desired constraints. But still on collision the player moves the payload a bit from its fixed path which i don’t want. How do i achieve this? Any help would be greatly appreciated.
How to achieve no impact on collision when colliding with a rigid body which is moving. Also I do not want the player to go through it.
Both payload and player should be kinematic rigidbodies. That way you have direct control over their movement so nothing unexpected will happen. Unfortunately you have to detect collisions on your own (you can use something like Physics.OverlapBox for that). Once you detect the collision you can push player away from the payload so they will never overlap with each other.