- Home /
Mario first person game, help?
Hello I am making a Super Mario Bros. 3d in First Person. And I need help on making the enemies, when I touch them I lose a life, and if hit them on the head they die.
Here's the video to show you the game, the progress of the game:
http://www.youtube.com/watch?v=AeSCAFziXew&list=UUw_DfacTczBOQh0RzFg-TXw∈dex=1
Answer by LightSource · Feb 05, 2013 at 01:41 AM
Bounce on Head to Kill:
Make a cube and position it it over the goombas head. Re-size it so it fits.
Parent the cube to the goomba.
Make it a trigger.
Apply this script to the cube:
var deathSound : AudioClip;
function OnTriggerEnter () {
Destroy (gameObject);
audio.Play(deathSound);
}
Attach an audio source in the open variable and your good to go.
If there are any problems, feel free to ask. Your demo is looking good so far.
You could even add
var deathSound : AudioClip;
function OnTriggerEnter () {
Destroy (gameObject);
audio.Play(deathSound);
animation.Play("die");
Your answer
Follow this Question
Related Questions
How can i call this void once 2 Answers
Kill the Player? 1 Answer
How to make enemys do damage and you dying etc 1 Answer
Canduct and movement of an enemy 0 Answers
Make an enemy follow along a wall 2 Answers