Forum rules - please read before posting.

Automatically skipping actionlists via C# variables

Ok, essentially I am implementing accessibility settings into my game, and I am wanting to add a setting to disable screen shake. The variables for these settings are held in a custom C# script. Is there a way I can set the screenshake action to automatically skip or disable when my screenshake variable is set to false?

AC version is 1.78.4
Unity version is 2021.3.1f1

Comments

  • While you could modify the existing Camera: Shake script, I'd advise against it as you'd need to apply the same change after updating AC.

    The best way to handle this is to move the Action to a new ActionList, precede it with a Variable: Check Action (so that the shaking only occurs if the variable has the correct value), and then replace all of your existing Camera: Shake Actions with an ActionList: Run Action that runs the asset.

    You can get a list of all existing instances of the Camera: Shake Action by selecting this Action type within the Actions Manager and clicking Find references from its side-menu.

    If you want to vary the values of the shake each time (e.g. intensity, or duration), create a Float parameter in the new ActionList asset and use it to override the field in the Camera: Shake Action. You can then set that parameter field in each ActionList: Run Action that calls it.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.