Jump to content

Some Collision "Rules"


Michael_J
 Share

Recommended Posts

I've been doing a lot of testing the past few days with physics objects and collisions, especially in the case of a physics parent ( mass > 0 ) with children with a collision type but mass == 0. This effectively creates a rigid union of two or more collision objects. One of the reason for this is that I've had no luck thus far creating "rigid" joints between physics objects that have no spring-like effects. Beyond that, in many cases I don't need the overhead of a joint for a simple union.

 

So, I thought I'd post my findings in case they might be of use for someone else. Here's what I came up with (collision reactions in all these cases assume valid collision types and responses have been set up) :

 

1) A parent physics object can collide with another parent

2) A parent and its children can have different collision types

3) If a parent has a collision type in which no responses allow for a physics reaction (Collision::Collide) then no reactions will occur EVEN IF the children have types and responses that allow for it

4) Children of one parent can only detect other parent objects, but NOT their children

5) Children with a Collision::Trigger response will detect ALL parent objects, EVEN THEIR OWN, if the collision types allow for a detection

 

So, let's say you had a chair made up of multiple objects. The "root" object has both collision and mass (allowing physics motion), while the children only have collision. Now, if you picked this chair up and threw it against a wall it would react properly--bouncing off the wall and falling to the floor; but ONLY if the walls and floor were one parent object (or each their own parent). If the walls were a child of the floor then only the chair's root object would collide with them, but all pieces would collide with the floor.

 

Being separate pieces though, you could then do things like detaching all the children when it first hit the wall and giving each a mass; thus making a breakable chair.

 

Your results may vary I suppose, but this is what I've found to be true, after a LOT of testing, when setting things up like this. By the way, if anyone knows a way to make a "rigid" physics joint (no spring-like motion when collisions occur) I'd be happy to learn smile.png

--"There is no spoon"

Link to comment
Share on other sites

  • 6 months later...

hi i have find something abbout this but another engine nearly your topic i thing its helpfully

 

It's pretty simple when you break it down. Do all of your attacks in Montages (Preferably with Root Motion), Have capsules over the fists / legs. When the montage is playing, set a bool that will change the collision of the capsules to something that will collide with the enemy. When the montage is over, set the bool back so it no longer collides. If the fists / legs collide with enemy while active, add damage.

 

If health = 0, then kill the enemy and what not.

Link to comment
Share on other sites

We would need a complete documentation and examples about all that "Obscure" collision rules tongue.png

 

It can become big headhaches each time people go advanced using collision and physics without proper docs or knowledge.

Thanks for sharing.

Stop toying and make games

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...