I was hoping to find out some information in regards to how Unreal Engine 4 handles multiple casts to a single blueprints, specifically what happens when more than one player calls a function in a blueprint.
Does it complete the first call then complete the second, or does the second call cancel the first call from running.
This is specifically surrounding adding instances in a master Instance Static Mesh (actor).
What I found out when testing this a while ago was this:
Events get canceled when called again and start over. Everything else works just fine.
If you call a function that one will also be finished. You will always get the return value.
Casting doesn’t impact anything. You are basically asking a thing “Hey are you an apple?” and the cast will say “Yes!” or “No”. It does not impact the object itself in any way.
Well the casting makes sense to me thank you. The event calls I’m still unsure about. If you have a shared event that gets called is the a way of buffering them. Or does the event tick as it were, so it completes everything in the chain every tick (cast to) of an event?
And as long as you don’t have anything that delays anything else there is no issue with Events either as the code will be run though and then another possible call will happen.
BUT if you use something like delay, load asset or such. Something that runs asynchronously and can not be completely immediately this becomes a problem.
For example:
You have a shooter. As not too experienced programmer you set up each projectile to include all possible things that could happen including a value for damage over time.
A projectile which deals fire damage hits you. You call your own event “FireDoT” which includes a self written loop and a delay so it will deal the fire damage once every second until a timer finished.
A frame later another projectile hits you, calls the FireDoT event as well but with less damage per second.
Your first event is canceled and only the second event runs now.