Rigidbody and kinematics

Hi all,

I’m trying to do something I thought was simple :slight_smile: (always the way isn’t it)

Basically I have an object I wish to ‘connect’ too i.e. push drag another object around (imagine a person grabbing a crate and sliding it around the floor in front of them).

My player is a character controller and the crate is a kinematic body.
To some extent I can get this working when they collide. But of course as the crate is kinematic the player can now push the crate through walls; which I don’t want.
I guess I am asking what the correct approach is here. Should I make the crate be non kinematic so it obeys physics and then connect with a joint to the player? (can a character controller also have a rigid body?, is that not a direct conflict??).
Any suggestions on the method would be appreciated.

I realize I want some physics sometime but not all physics all the time :slight_smile:

thanks

the most simple way would just be to make the cube a child of your character, then it would move with you.

Thanks , but should it be a rigid body ? . And are you suggesting when I grab the object to destroy the original and create a child off player ? . Please provide more detail

Thanks

I would make it a rigidbody. That way youre sure it would stay on the ground, and if you say pushed it off a ledge it would fall. And no dont destroy the original, just put box.transform.parent = player.transform. That way it will move with you.

Hi,

Can’t quite get this working. Am I trying to get the collided bodies rigid body to be a child of the colliders rigid body?. I thought you weren’t meant to directly move rigid bodies unless kinematic??. Please more detail.

thanks