- Home /
Question by
pessoa_normar_que_bebe_agua · Jul 21, 2020 at 10:15 AM ·
scripting problemcollider2d2d-physicscollision2d
how to make a 2d colider script detector,how mto make a simple colision detect2d script
im tring to make a 2d colider detector script but no results thats my script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class circulo : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnCollisionEnter2D(Collision2D other)
{
Debug.Log("hit");
}
}
Comment
Answer by Zoedingl · Jul 21, 2020 at 02:35 PM
Has your object a collider, with the "Is Ttrigger" variable false? It must have it in order for this script o work.
Your answer
Follow this Question
Related Questions
How to make a little wiggle room for the collision? 1 Answer
How do I set an object's velocity to the velocity of an object that collided with it? 0 Answers
Fix Collision of Jumping On Floating Player 0 Answers
Rigidbody2D with edgecollider adding force on collision 0 Answers
how to make AI change from patrol to chase within a certain range 1 Answer