- Home /
Coins Adding in a Flappy Bird Game
Hi, I want to add coin collecting in my first game which is meant to be like a Flappy Bird Style Game in Unity 4.3.4
What I have is A 12 by 16 size Coin image, Coin Collected Sound and A script for ScorePoint
using UnityEngine;
using System.Collections;
public class ScorePoint : MonoBehaviour {
void OnTriggerEnter2D(Collider2D collider) {
if(collider.tag == "Player") {
Score.AddPoint();
}
}
}
I want it to be like when Player has collided with the image, Sound Plays and The image itself disappear but when pipes (where the image will be) has collided with the looper (which repeats the background and the pipes) the image should appear again and the sound should play again. What should add and how?Please tell me in detail because I want to learn as well.
Answer by carmanroofer93 · Mar 03, 2020 at 02:51 AM
i was hoping someone had answered this as im currently having the same issue lol, everything works fine except the coin doesnt disappear it just stays there and collects the point, then i added destroy(gameobject) obviously it worked until it tried to spawn what i had destroyed... wondering if you ever found a fix?
Your answer
Follow this Question
Related Questions
how to add a sound when collecting coins? 0 Answers
Adjusting system audio levels... Please help! 1 Answer
Stop Specific Audio on a Script with multiple Sounds? 2 Answers
Save audio to a file [Solved] 6 Answers
Sound stop when entering trigger 3 Answers