Jump to content

Breakable physics try


YouGroove
 Share

Recommended Posts

I wonder how we could simulate breakable physics ?

For example i have piece of some wood made of some 3 or 4 parts :

Place them in the map with :

No gravity or no physics

When player hit them, activate physics and gravity and let them fall down.

 

Or have two versions, one not broken and a broken one of the model, when player hit the model, remove the normal version of model and replace it with some prefab having all pieces together, with no gravity, than activate gravity and add a force from where the player stroke ?

Stop toying and make games

Link to comment
Share on other sites

I was doing this in my castle demo with that brick wall i posted a while ago using LE 2.5 If you want it to fall set the unbroken to a mass of 0. This will set it so that it isn't affected by gravity. In your object class, set the collision callback function to react to the unbroken model. have it call a break function that will move all the broken children to the location of the full model, set the velocity of the full model to each broken piece, show them and set their mass to 1. Keep in mind i was having some performance issues with 3.0 but i've been told that the cause of these issues have been resolved in 3.1.

bool Life()
{
 while(death=false)
 {
   if(death==true)
   return death;
 }
}

 

I have found the secret to infinite life

 

Did I help you out? Like my post!

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...