I have searched the forums and what not and could not find an answer to my problem, I have a 2d trigger collider and a rigidbody2D set up on my bullet, and I have the same set up on the enemy object only the collider is not a trigger.
#pragma strict
function Start () {
}
var EnemyObject : GameObject; //Implement your Faller game object into this variable in the inspector
function Update () {
transform.position.x += 15 * Time.deltaTime;
if(transform.position.x > 8) {
Destroy (gameObject);
}
}
var eAnimation : Animation; // choose the animation which will start when triggered
function OnTriggerEnter2D (Other : Collider2D){
if(Other.gameObject.tag == "Enemy"){
Destroy(EnemyObject.gameObject);
EnemyObject.animation.Play("eAnimation");
}
}
I have set up what the object is in the inspector, and also a side question, it won’t let me assign an animation in the inspector for eAnimation?
Here is the quick video of the problem demonstrated in game :Video Link
And here is a picture of the enemy sprite and its colliders :
Thanks for reading any kind of help is appreciated.