- Home /
Question by
Albert-han · May 24, 2014 at 11:34 AM ·
pickupnotworking
Pickup script not workimg
Hello im working on a 2d game like mario and i need a coin script. Im not having any errors but i just go through the coin which i made from a sphere. Here's my script,can anyone tell me what i did wrong?thanks
Coin script
var CoinSound: AudioClip;
function OnTriggerEnter (info : Collider)
{
if (info.tag == "Player")
{
ScoreSystem.myScore += 1;
AudioSource.PlayClipAtPoint(CoinSound, transform.position);
Destroy(gameObject);
}
}
Score system
var CoinSound: AudioClip;
function OnTriggerEnter (info : Collider)
{
if (info.tag == "Player")
{
ScoreSystem.myScore += 1;
AudioSource.PlayClipAtPoint(CoinSound, transform.position);
Destroy(gameObject);
}
}
Comment
So your CoinScript and your ScoreSystem have the same code, right ...? Edit your Question and you may get an answer.
Your answer
Follow this Question
Related Questions
Can't get bullet to spawn and move 1 Answer
GuiButton Going To Next Level 0 Answers
Script not working 0 Answers
Following Script Not Working Properly 0 Answers