Flash grenade

I bought a grenade pack off Sellfy but I do believe it was meant to be a template instead of a working grenade.

The flash grenade in the pack adds a PP effect but it applies it at the grenade itself and if you take a few steps backwards you will become unflashed since u are out of the blast radius.

I’m looking to create something more along the lines of the CS:GO flash grenade if anyone had a minute to help out it would be much appreciated. Thanks!

you should add a postprocess component to your character, and set its auto exposure max brightness to 0, and set its blend weight to 0. then, whenever you receive damage in your character, you could have a FlashBang DamageType, and when you detect that damage type, you could trigger a timeline with a float track that controls the blend weight of your post process component.

70795-flashbangpp.png

adding depth of field and blur to the post process component might help a bit, and if you want an after image affect, you will probably have to use a scene capture component to render to texture, and use UMG to display the texture in a widget, with an animation that fades out the texture.

you can also add a lerp after the timeline, before setting the blend weight, and you can control the Alpha value with the timeline, and control the B value based on some vector math. using dot product, you can compare the direction the camera was looking with the direction towards the flash grenade when it went off, and you can use that to determine the B value in the lerp. that way, you get less flashed the more you look away.

Got it working, will just have to mess around with the timeline a bit to see how I can perfect it.

Surprised I got it working as seeing how new I am to UE4, now to get it incorporated into an actual grenade.

Also can’t seem to get the motion blur and DOF to work properly on the timeline.

i would just use the timeline to control blendWeight, and set the motionblur and DOF inside the postprocesscomponents default properties.

I will play around with what you have said. Appreciate the help!

This what you was talking about with the lerp?

yeah, but you should have a variable that you plug into B, based on how much the player looked at the flash. if you get the dot product of the ControlRotation’s fowardvector, and the ( GrenadeLocation - CameraLocation ) normalized, you will get a number between -1 and 1. if you add 1 and multiply by .5, you can use the result to set the FlashedAmount float, then plug that float into the Lerp’s B input.

Appreciate your help. I have it working now.