# Object->Object crack

Is there a way to make an object shatter to peices when another hits it? Soft bodies? How?

I thought u made many games b4… learn the basics. NOT TRYING TO SOUND MEAN, but Im just saying. Use Replace mesh actuator, and python.

oh, sorry, what about only objects going x speed?

wtf? lol, what do u mean?

you have to be going fast enough to break the object.

here ill make u a demo blend of the breaking car.

ok here it is
Just ram into the wall and viola.

http://www.savefile.com/files/951999

the wall doesnt break…

no that car does. lol

well, the car doesnt break.

Doesn’t it destroy? Change into another image?

no, have you tried it? From the looks of the actuator it should work…did you make the broken wall object?

nvm. Just continue what u were doing

Killer, that demo’s pretty awesome, but i think he ment something shatering, but i wouldn’t know how…

When I play it the car just bumps into the Wall, nothing happens.

I want to know how to make the wall breakn ONLY if your going really fast. Do you need python for this?

Yeah you need python for that. I suspect that the speed of an object would be the absolute values of the x, y, and z linear velocities added together.

You can get that with:

``````# import the math function "abs" (absolute value)
from math import abs
# get the linear velocity of the object
array = owner.getLinearVelocity()
# add them together
speed = abs(array[0]) + abs(array[1]) + abs(array[2])
``````

WARNING:
Not a complete program, only a snippet.
“owner” must already be defined for this program snippet to work.
Also I have never tried this, so I really have no idea whether it will work or not.
And I am not sure that “abs” is to get the absolute value. If it is not, them replace it in my code with whatever is.

in tutorial 8 that you will find here:

You will see how we make the bot shatter, in many interesting ways.
For living things we call the shattered parts Gibs .
It will be somewhat the same way for your car, just make a copy of your car model, and disassemble it into 5-20 pieces .
Try not to add all the gibs/fragments at once… be sure to follow the part about scheduling the objects being added to the screen, or you will get major Hiccups/Lagg the first few times the car explodes.

If you dont want to make a new texture for the burned pieces, I recommends just using vertex paint, and add some black or dark grey to a few of the edges.

Sorry, I have no idea how to calculate velocity. I would just cheat and make a timer for how long the accelerator key is being held down. After a few seconds, it will make so then when the car hits the walls it will explode.
When the key is not pressed, have the timer count backwards.

Not the greatest workaround, but it might come in handy.

How do you run you tuts mmph? When I play it the bots disappear. and nothing happens

If you are looking at tutorial 5-8, I have them spawning from layer 2…

Just wait a few minuets, they will start coming out of the doors.

You need blender 2.44, you also might need python 2.5

Does blender 2.42 work?:evilgrin: