How does Unreal manage the function call of 2 classes instances at the same time ?

Hello guys i’m wondering something.

Let’s assume this case :

I have a game project with a custom Volume and a custom Character subclass.

On my level, i have 2 instances of my Character one controlled by PlayerController and the other by AI.

Also on my level, i have multiple instance of my volume class.

Now the questions :slight_smile:

Is it possible that my two characters enter 2 different volumes at the same time (same frame ) ?

If yes

  1. Does the volume respective functions (i.e OnActorReceiveOverlap) will be call at the same time within the engine ?
  2. If yes does the engine does parrallel execution ?
  3. if no does the engine does subsequent execution ?

Finally, How does the engine manage functions call of multiples instances at the same time ? In parrallel or one at the time ?

I need a clear answer if possible, i search on the doc and this kind of informations is not explained.

Other thoughts

On the volume event function i create some objects on certain circonstances

I tried to create objects on another thread but it’s not supported yet.

If you need more infos just tell me :slight_smile:

gamer08

Hi gamer08,

The Engine is not able to process two functions simultaneously. One function will always happen before the other. I reached out to some of our developers to find out how the Engine determines which function to call first, and it sounds like there is no official definition for how this is handled. It may be based on creation order, but you may not want to rely on that always being the case.

If the functions in question are not related in anyway, and don’t care about what the other one is doing, then you most likely won’t have any problems. However, if you need to make sure that one function always happens before the other if they are called “simultaneously,” then you will want to include a check to ensure the second function is delayed briefly if it was called first. Using a very brief delay or timer will allow the other function to be run first.

Thanks for the answer Tim. It’s this answer i’m waiting for :slight_smile: I Like this and you make my day :slight_smile:

Thanks again and have a great day !

gamer08