How to Create Destructible object in unity.
Page 1 of 1
How to Create Destructible object in unity.
Create Destructible environment in unity 3D – Method 1
Mission : A bridge which breaks when cart bumps into it!
Step 1: Add a new gameobject Cube and scale it to create table top. Add a rigidbody to it. Keep the mass 1 (we can change it as later as required according to the type of object we want to create). Rename gmaeObject to top.
Step 2 : Now Duplicate it (Ctrl + D) and scale it to create leg 1 upper part and add fixed joint (Component -> Physics -> FJ) , Choose connected body as top.make break force as 2. Leave break torque as it is. Rename it as 1-1.
Step 3 : Now Duplicate it (Ctrl + D) and scale it to create leg 1 lower part and add fixed joint (Component -> Physics -> FJ) , Choose connected body as 1-1. Make force as 5. Rename it as 1-2.
Step 4: Repeat step 2 n 3 three times to create other 3 legs.
Step 5 : Use any normal FPS walker to check your bridge.
Replace your cubes with textured models for proper in Game asset.
Also club your model assets using Empty GameObjects(Empty GameObject does not contain a mesh and have position and rotation as 0 and scale as 1).
Now when you make anything bump into your bridge , it comes down crashing.
Method 2 :
that's though scripting!! will tell later .
The sample Project Code!
http://rapidshare.com/files/420770473/Destructible.rar
Mission : A bridge which breaks when cart bumps into it!
Step 1: Add a new gameobject Cube and scale it to create table top. Add a rigidbody to it. Keep the mass 1 (we can change it as later as required according to the type of object we want to create). Rename gmaeObject to top.
Step 2 : Now Duplicate it (Ctrl + D) and scale it to create leg 1 upper part and add fixed joint (Component -> Physics -> FJ) , Choose connected body as top.make break force as 2. Leave break torque as it is. Rename it as 1-1.
Step 3 : Now Duplicate it (Ctrl + D) and scale it to create leg 1 lower part and add fixed joint (Component -> Physics -> FJ) , Choose connected body as 1-1. Make force as 5. Rename it as 1-2.
Step 4: Repeat step 2 n 3 three times to create other 3 legs.
Step 5 : Use any normal FPS walker to check your bridge.
Replace your cubes with textured models for proper in Game asset.
Also club your model assets using Empty GameObjects(Empty GameObject does not contain a mesh and have position and rotation as 0 and scale as 1).
Now when you make anything bump into your bridge , it comes down crashing.
Method 2 :
that's though scripting!! will tell later .
The sample Project Code!
http://rapidshare.com/files/420770473/Destructible.rar
Ryan- Reggae Speed: Programmer
- Posts : 16
Join date : 2010-09-22
Ryan- Reggae Speed: Programmer
- Posts : 16
Join date : 2010-09-22
Similar topics
» Unity 3 released!
» Best starting programming language in Unity
» New project software has been choosen (Unity 3)!
» Best starting programming language in Unity
» New project software has been choosen (Unity 3)!
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum