- Home /
Question by
unity_838FD7736BFA48D1E745 · Dec 01, 2021 at 10:20 AM ·
unityeditorunity 4
I tried this Code For Collision Detection And Destroy Game object But my Car (Game object) not Working smoothly
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class CollisionDetection : MonoBehaviour { public void OnCollisionEnter(Collision collision) { Debug.Log("Collided With + WALL" + collision.gameObject.tag);
if(collision.transform.tag.Equals("WALL"))
{
Destroy(collision.gameObject);
}
}
} My Code . When Gameobject Collides with Other game object they Stop for While.
Comment
Your answer
Follow this Question
Related Questions
Unity LoadAssetBundles changes Material into Pink ? (URP) 0 Answers
when i build run for IOS then it shows error 0 Answers
Moving Line with Collider 0 Answers
all of my Projects are gone 2 Answers
UI Buttons dont react on click 4 Answers