Hello! For my top-down game I am trying to create a system so that when the character goes inside a room, whatever is between the pawn and the camera becomes opaque. The way I am having this happen is by creating a component that contains the function to make it opaque, and having a collision volume between the player and the camera. So when the player overlaps the scene component, it’ll make it invisible.
This means that in order for it to work, I have to enable “generate overlap events” on every actor that I want to become invisible, which leads to my question: Is “generate overlap events” expensive to have ticked on many actors? Or is it not that big of a deal?
Hi there, i guess this is pretty relative compared to your alternatives.
I would suggest to take an actor, configure it and duplicate a decent amount of them in your level. (just a few alt+drag when selecting a whole duplicated bunch over again). If your profiler doesn’t burn, i guess you should be good
This is what i did with the Menger-Sponge fractal: Over 6000 actors, all of them with overlap events, and ingame there are about 20 pawns speeding around on the surface where every pawn overlaps with about 4 of them. No issue at all.
So, 1.5 years later, I’ve picked up on a few things:
Overlap functions are native Engine functions; they are handed by C++, directly, and not calculated with a virtual machine. As such, they are VERY fast and pretty cheap. The only time you run into trouble is if you have many actors calling many overlaps over and over in quick succession.
Yes, they are tick functions, but they are native, inexpensive tick functions. You can put dozens of them before you find any real consequence.