Hi
i am creating 2D game to drag letters and put them in the right order or place and make some action when put them in the correct order like sound .Anyway , i am using trigger so when i drag the letter to that trigger, it should give me that sound, but it doesn’t. unless i use Rigidbody 2D property the letter (which i dont want to use Rigidbody).
this is the code i use for the trigger:
using UnityEngine;
using System.Collections;
public class GameTrigger1_1 : MonoBehaviour {
public AudioClip au;
public void OnTriggerEnter2D(Collider2D collisionObject){
if (string.Equals (collisionObject.tag, "D")) {
audio.PlayOneShot(au);
}
}
}
i already give the letter BoxCollider 2D property, and i dont know its not working and give me any output while i drag the letter to the trigger, looking for your help
thanks