I made a Flappy Bird clone recently following a tutorial by GMTK. I added a gun to the game that is supposed to open the pipes when the bullet hits a target. The pipe animation plays when they are made and I don’t know how to fix it. There is also a error that says my collider failed verification. I made a video explaining my problem.
Here is my code to open the pipes.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class pipeOpener : MonoBehaviour
{
public Animator Anim;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.gameObject.CompareTag("Open"))
{
Debug.Log("played");
Anim.Play("pipeOpen");
}
}
}
Pls help.