I’m making a small game and im trying to optimize it to its fullest. The game consists of a lot of bullets spawning while the player tries to dodge them.
The biggest issue unsurprisingly are the hitboxes.
I’m using a module called “GuiCollisionService” made by jaipack17.
The module works fine, and its spending a lot of resources so i added a simple condition thats subtracting 2 AbsolutePosition values and getting their magnitude to then check if its smaller than an amount.
Getting the AbsolutePosition value however seems to be really expensive aswell.
Are there any alternatives i can use instead of this? Or maybe an even better method of collision checking.
When I made my own 2D collision I made my vertices (or bullets in your case) a class, that class will have a “Position” value that the actual bullet UI will be set to every frame, that removes the problem of getting AbsolutePosition as you have it stored inside the class, you can even use it before moving the UI if you want, but better it’s better to not do so.