Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(+1)

Hi! That's a cool way of using the effects :)

Changing values at runtime on URP works something like this:

1) Get a reference to the Forward Renderer Data asset. The easiest way is to assign in the Inspector (this is the asset which contains all the Render Features):

public ForwardRendererData forwardRendererData;

2) Get the list of Render Features from that. It's a List<ScriptableRenderFeature>.

var features = forwardRendererData.rendererFeatures;

3) Iterate through the list and find the specific effect you want to modify. If you've only got, say, a Radial Blur effect applied, it's as easy as picking the first list element and casting to RadialBlur, for example:

RadialBlur blur = (RadialBlur)features[0];

If you've got a bunch of effects, you'll need to cycle through them all until you find the one you want.

4) Modify the property you want. Probably a good idea to do a null-check just in case. The settings variable is a struct which contains all the properties for a given effect - it's set up in the exact same way for every effect.

if (blur != null)
{
    blur.settings.strength = 27;
}

Please note, any changes you make in Play Mode using this approach will persist when you stop playing. I hope that helps! I'll be updating the documentation included in the asset pack to outline this process in the next major update.

(+1)

Just implemented this and it works a treat! Thanks a bunch mate 😁