- Home /
How Can I Make My Player Split Into Pieces When I Loose The Level?
How Can I Make My Player Split Into Pieces When I Loose The Level Like On Redball?
this is a basic technique in video games
you SWAP the whole thing for a different model.
for example, you might have "my spacecraft normal" and "my spacecraft is smashed on the ground" and "my spacecraft flying in to pieces"
there are 1000s of questions on here about it
yep, animation. But the asker seems to be on the dawn of his program$$anonymous$$g career so...
Answer by Stabiee · Oct 03, 2012 at 10:49 AM
The best way of doing this is if you use a animation with another model, so tell it to swap to another model with a animation of it breaking up. You will need to make the animations in a 3d modeling program such as Blender. im sure there are youtube videos on it some where as i don't tend to do my own animations.
To make a swapping model script, you just:
deactivate/destroy the object that's about to blow into bits
instantiate a prefab at the exact place where the previous object was destroyed
It's not particularly complex.
Answer by fafase · Oct 04, 2012 at 05:44 AM
Might sound weird to some, but what about unparenting all children, adding a rigidbody and add an explosion in the middle of the object.
It will look like your character is bursting from inside.
I've thought about that - it sounds cool too, but I'd really like it to split into pieces
ok had a go at righting the script:
var Level = 1; var Is$$anonymous$$ill = true;
function Start(){}
function OnTriggerEnter (trigger : Collider){ if(trigger.gameObject.name == "Player"){ if(Is$$anonymous$$ill == "false"){ Application.LoadLevel(Level);} if(Is$$anonymous$$ill == "true"){ ConfigurableJoint.swapBodies.Player = PrefabType.Split; yield.WaitForSeconds(2); Application.LoadLevel(Level);}} }
Theres are errors saying: unexpected token '.' in WaitForSeconds and also an error saying to access swapBodies I need some instance of ConfigurableJoint. Can you help me fix this?
ok damn still can't get it working - do u know how I can fix it?
Your answer
Follow this Question
Related Questions
Life Player loads another level 1 Answer
How to update unity web player 0 Answers
Change scenes from area? 1 Answer
Designing a room as efficiently as possible 2 Answers
Score Question Java Script, problem 1 Answer