|
I'm building a concrete block wall out of a simple mesh that I imported from Blender. I can duplicate them and attach them with a rigid joint that will make them break apart if hit hard or just fall over as a whole if pushed gently. What I want to do is import a fractured copy of this concrete block and replace the whole block if it struck hard enough. I'm trying to do this because I think Unity will have an easier time keeping track of a few hundred rectangular blocks as opposed to a few thousand block pieces. Thanks.
(comments are locked)
|
|
"If you want to replace a wall composed by many objects with a single dead replacement object, no problem: just assign the dead replacement. If there are childed parts, match hierarchy and names of the dead parts to well chosen original equivalents." Does this mean that I can't have multiple objects replacing one dead object, or that I have to replace the dead object with with a parent object(ex. an invisible box) that has the block fragments as children? Thanks for your help, and for that tutorial link. I haven't seen that one yet.
(comments are locked)
|
|
This is a "dead replacement" case: an object is destroyed and replaced by a "dead version". The FPS Tutorial gives a good lesson about this in two scripts: DamageReceiver.js and CharacterDamage.js (read also the PDF docs FPS_Tutorial 1 to 3). The first script is used in simple things like barrels, crates, furniture, etc. while the second is used in characters or other complex objects composed by several parts.
var hitPoints = 100.0; // object "health"
var deadReplacement: Transform; // drag the "dead version" here
var dieSound: AudioClip;
function ApplyDamage (damage : float) {
if (hitPoints > 0.0){
hitPoints -= damage;
if (hitPoints
(comments are locked)
|
