How to detect a simple collision

So, i want to detect a simple collision, i dont need rigidbody, because my objects of all types must be able to go through each other like ghosts, and i dont need physics. I have two objects(sprites) - bullet and enemy, i have attached 2D colliders to these objects, i have tried all combinations of istrigger checkboxes, and i have functions “oncollisionenter2d”, “ontriggerenter2d” in bullet script, but no collision/trigger is detected, how can i make it to work ? I got it to work with rigidbody2d, but again, i cannot use it, because it breaks the point of my game.

You have to use a rigidbody2d to detect collisions. Did you try to make it kinematic?

Well, it doesnt work with kinematic, but without kinematic, it works, and again, it breaks the point of game.

Did you consider collision layers:

It works, but what components can i remove ? Does it use rigidbody2d ? collider2d ?

You need both, rigidbody and collider. I am not a 2d expert. As far as I know, it is necessary that if two rigidbodies/colliders are colliding, that at least one of them is not kinematic.

(disclaimer - Artist here)
Can’t you use rigidbody and colliders and turn them on/off when needed (timed/area/proximity) via code?

Sorry if that an obvious ‘NO’ answer.

In my game, during big action, there could be at least a few thousands enemies and 100-400 bullets, so i dont know, if always iterating through all of them and checking distances and turning body/collider on/off would be faster, plus most of these components would be turn on during big action, and for small action it doesnt matter. But maybe i will try it later after other things, wont hurt.

Hey Guys… I’m having a problem with collisions. I’m using a circle collider on my character and when I jump while holding the arrow keys, sometimes the character floats in the air.

This video demonstrates what is happening http://take.ms/QUDpD

Thanks For your attention.

Is that wall edge collider ? if not you could try to change it to edge collider, if you used box collider for wall. Or you can try to look at free examples - Unity Asset Store - The Best Assets for Game Making , there is good 2d character controller example between these sample projects.

I tried the edge collider, but still the same issue. =/
This is all new for me… thanks for the samples link.

@emersonbroga - please be considerate of the original poster who started this thread to see if he could find help for the problem he is having.
If you have a similar issue it’s best practice to start your own thread and you can link back to this thread from yours. This gives each person the best opportunity to get directed assistance from the community without complicating things. :slight_smile:

Welcome to the community!