- Home /
How To Create Objects That Can Move and Still Break?
Hey guys, I'm having a hard time finding any real information regarding this question:
My friend asked me to learn to do this for her and its pretty easy. My problem is, I have been able to create an original object at a specific transform position, and then create the prefab at the same transform position so that it appears to have a breaking effect.
What I need to know how to do is, to be able to swap a broken set of pieces for the original but allowing in-game circumstances to move the original around before it breaks.
i.e. If i have a destructible box that will break from my hammer, what if I push the box to the other side of the room before smashing it? the broken pieces need to instantiate at the dynamic position.
Please help?
Answer by FreeTimeDev · Jan 02, 2015 at 08:48 PM
You put all of the movement code on the original game object.
When you break it (hp reaches zero or whatever) you replace the object with the prefab with several parts/pieces that explode/fall apart. That could be an animation or using unity physics.
Your answer
Follow this Question
Related Questions
Limiting Drag and Drop 1 Answer
Why do my objects keep changing speed? 1 Answer
Move an object without Character Controller? 1 Answer
How to move an object from one position to desired position? 0 Answers
Objects aren't moveable? 1 Answer