- Home /
Question by
FoxHound9001 · Apr 29, 2021 at 09:06 PM ·
c#collisionuivisual studio
Collider trouble
I put the tag Ball over my key to collide if it activates the wall;
But when it collides, nothing happens;
This is my code;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Wall : MonoBehaviour
{
//public GameObject wallActive;
private void OnCollisionEnter2D(Collision2D other)
{
if(other.gameObject.tag == "Ball")
{
Destroy(this.gameObject);
//wallActive.gameObject.SetActive(true);
}
}
}
I need help.
giphy.gif
(134.4 kB)
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Coin pickup script not working..? 1 Answer
Change image in UI depending on the value of the slider 0 Answers
On collision nearby objects ui view (scroll view) 0 Answers
Distribute terrain in zones 3 Answers