I’m using sprites a lot in my game, they are used for enemies, particles and debris etc pretty much everything.
To make the sprites “collide” with the world, I’m using a invisible box and calling moveWithCollisions on it. I then just update the sprite position to the box position
This works great, but I would like more performance.
moveWithCollision seems like the only function that will work as I have a complex level design. I tried to use intersectMesh but doesn’t work with my design.
My PC seems to hit about 500 of these objects before I get I get frame drops. e.g. < 60 fps
I’m using instancing for the “colliders” which gave me a small boost.
The function that seems to be slowing me down is moveWithCollisions().
Please see a playground below with a basic example of what I am doing:
If anyone could think of ways to optimize or other solutions that would be really appreciated.