Is calling OnCollisionEnter2D on allot of GameObjects leading to worse performance?
Hi!
I want to make a 2D game for mobile devices using C#. The goal of the game is to shoot objects with a bullet. In my scene I have always only one bullet and around 70 targets.
Is it better for performance to have ONE Gameobject (the bullet) with a script having the function: OnCollisionEnter2D, or is it okay to have around 70 Gameobjects that all have a script with the OnCollisionEnter2D function?
I ask this because if the OnCollisionEnter2D is called every frame like Update (not sure about this), its probably better (for performance) to call the function only on one Gameobject, rather than on 70?
Thanks in Advance!
Note: I'm just starting out with Unity. This is also my first question on the forum. I'm sorry if i ask this in the wrong place or if my question is not clear enough.
Your answer
Follow this Question
Related Questions
Problems with raycasting 2D. Probelmas com raycasting 2D. 0 Answers
Unity Overlap Point Causing Error 0 Answers
Can't make the player attack an enemy 0 Answers