How can I make my character collide with physics objects?

Hello there everyone! Im quite new in game development and i just want to know how can i imitate the physics in Max Payne? when Max walks and collides with boxes the boxes push away. I think there is a component needed to be attached to the player and the object in order for this to work but i dont know what are the settings for this please help if it is possible :slight_smile:

You’re talking about one of the very basics of an engine like Unity: collisions and rigidbodies.

Run through a tutorial or two to get your bearings (and see examples of collisions in action - they’re in almost every one). Read through the documentation on the Unity site (under support) and read up on the individual functions you’re concerned with.

Colliding with objects and having them be affected is built in but you’ll need to know how Unity’s system works before you’ll actually understand why.

In order to make anything collide with rigidbodies, including other rigidbodies, an object must have a Collider component attached to it. That is the only requisite.

If you want to test this, it’s extremely simple.

One, make a simple placeholder for your character. Wire it up with extremely simple movement through scripting. Apply a Collider to the character.

Put rigidbodies around the scene. Walk your character into them, and they will be pushed around. It’s quite simple, really. I recommend reading about this topic in the manual. Everything I’ve said is covered in it.