- Home /
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 :)
Since I have very limited experience myself, I can't answer your question. But as a hint to draw in people who might know stuff: change your title. People around here don't like to answer questions like 'how can I mimic game x-y'. Just make it 'how can my third-person-character push GameObjects around when he collides with them?".
Also remove the 'max payne'tag. If someone was looking for the same answer as this question could provide, chances are very low that they would check for 'max payne', as this is by no means specific to this game or anything....
However, it's quite possible that this question has been answered before. $$anonymous$$aybe you'll consider looking for it yourself first. That would be greatly appreciated. Use the custom unity google search http://www.google.com/cse/home?cx=002470491425767499270:iugs1ezlsfq and look for something like 'pushing boxes around' etc...
Greetz, $$anonymous$$y.
I've edited the title and tags to better reflect the actual question.
Thank you bro! im not that familiar for this kind of mistake in title and tagging about this matter please bear with my beginner's disease. :)
Answer by Chris D · Jul 21, 2011 at 03:30 PM
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.
Answer by Jason B · Jul 21, 2011 at 03:31 PM
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.
Jason i understand th use of rigid bodies but i need a better example for it, e.g. using the built in 3rd person character you can attach a rigid body into it and set the kinetics, etc in the inspector.. and create a simple cube and apply rigid bodies into it with these settings. To be specific i used $$anonymous$$ax Payne as an example for that kind of physics (there so many kinds of physics application in games anyway) simple as the box will be pushed aside when i collide to it.
Your answer
Follow this Question
Related Questions
Detecting Touch on moving Object - Help Needed! 1 Answer
Non slippery movement 1 Answer
No Collision 3 Answers
Small objects don't collide 1 Answer