I would want to try something else. Here is a chunk of my Blueprint. It works. It shows a red screen when taking damage and the character is losing health. But I would want to do it a different way than with the delay I have some colleagues that told me that Delays are not really good in a real pipeline, that should use them only to experiment.
So could I create some kind of timers that does the same thing than those delays here?
Thank You, I ain’t really familiar with Blueprint.
You can use timers/timed events if you do not want to use delays. A timer will allow you to continue executing code while it ticks down to 0 and fires away.
You should avoid delays in situations that are dynamic. That means, if you are not 100% certain that the timing of the delay is going to be the same every instance, then you may want to use a timer instead, or your code can lock up. (As in, a vital function will have to WAIT until the delay is complete.)
Your colleagues may be informing you with regards to their personal workflow. Keep in mind that there is no ONE way to do anything in Unreal. And as long as you are logical, you’ll be fine.
EDIT: It’s also VERY good you are asking questions. Don’t let anyone make you feel uncomfortable for not already knowing what they may know. There’s too much of that here.
This is true, delays are cursed. Timers are delays. With them you take your code out of a natural order into the future where it might or might not execute, this becomes messy and hard to debug. You can also not use delays in blueprint functions.
I prefer using the observer pattern (delegates, called Event Dispatcher in blueprint), so when something happens (event broadcast) a ‘listener’ immediately responds. Since you want to display a red tint when your character gets hurt, the broadcaster of the ‘hurt’ event should be your character and the listener a UI element which displays the tint. This keeps tint logic out of your character who is not supposed to do anything else than be a character.
How could add so much reroute nodes, after the second one when I connect it to the do once reset the connection between the 2 last reroutes breaks off. I truly not understand how it works.
Hello! Jumping here with a question: a project where character enters a teleporter and I don’t want the teleportation to be immediate but 1 second after overlapping collission, how can I accomplish that without a delay node?