- create new game object, name it asteroid, set to origin then move it to z 8
- select asteroid model from model folder and drag onto asteroid in the hierarchy so it is a child of the game object
add a ridigidbody, turn gravity off and add a capsule collider, scale to the size of the asteroid
you can make the asteroid spin by using the code bellow how ever for my game i did not need to use this
add a new script to the asteroid component called destroy by contact
write this code
then go back into unity, go to the bounday object int he hierarchy and tag it as bounday
open the destroy by contact script again write
No comments:
Post a Comment