|
im trying to make a game like minecraft but im having trouble with some things how do i make a script that all i have to do is add it to a cube and set how strong it is like dirt or stone intesity and add it to a invetory plz help
(comments are locked)
|
The question has been closed Jan 21 at 10:24 AM by Fattie for the following reason:
Duplicate Question
|
Something along the lines of var cubeStrength : float; function OnCollisionEnter() { if (cubeStrength <= 0) { } } Simply apply this code to the cube, set a strength in the inspector window (higher number for stronger material). Each time you hit the cube the cubeStrength will be decreased by one point. Once the value hits 0 it will be destroyed. thank you ill give it a try but when i make a new script for it do i delete everything there and just put that in and is it c++ or java sorry i am a newbie but im trying to learn
Jan 26 '12 at 09:26 PM
kidrockkenny
thanks guys it worked
Jun 02 '12 at 01:43 PM
kidrockkenny
(comments are locked)
|
