Quantcast
Viewing all articles
Browse latest Browse all 99

Answer by murkantilism

Attach a [collider object](http://docs.unity3d.com/Documentation/ScriptReference/Collider.html) to the player and the cube. Write a script that you will attach to the cube. The script should check for a collision with a game object with the tag "Player" or whatever your player object is tagged as. Once the collision occurs, have the animation play using [animation.Play();](http://docs.unity3d.com/Documentation/ScriptReference/Animation.Play.html). Then destroy the cube with [Destroy(cube)](http://docs.unity3d.com/Documentation/ScriptReference/Object.Destroy.html).

Viewing all articles
Browse latest Browse all 99

Trending Articles