Blinking Player Visibility on Damage
6. Blinking Player Visibility on Damage
To achieve the flickering visual effect on the Infiltrators, you're going to repeatedly hide and show each player's character. You want this to occur in a function whenever an Infiltrator gets damaged, but you also need to make sure that the rest of your code keeps running when this function is called. This gets even more complicated in situations where you have multiple Infiltrators. There might be multiple Infiltrators damaged at the same time during a game, so you'll need code that can handle each of them individually.
To achieve the flickering visual effect on the Infiltrators, you're going to repeatedly hide and show each player's character. You want this to occur in a function whenever an Infiltrator gets damaged, but you also need to make sure that the rest of your code keeps running when this function is called. This gets even more complicated in situations where you have multiple Infiltrators. There might be multiple Infiltrators damaged at the same time during a game, so you'll need code that can handle each of them individually.
To achieve this, you're going to make heavy use of the spawn expression. Spawning a function allows you to run it asynchronously, without putting the rest of your code on hold. By spawning a function for each Infiltrator, you can ensure that each Infiltrator's flickering happens independently of the rest.
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.