Forum rules - please read before posting.

changing scene settings for each scene

How do I change the settings in each scene?
for example, in one scene I want to increase the hotspot ray length.

Comments

  • You can change the value of any Settings Manager field through script - right-click on the field's label to get an API reference to it.

    In the case of the "Hotspot ray length", it's:

    AC.KickStarter.settingsManager.hotspotRaycastLength
    

    However, such fields are game-wide - so you'll need to manually revert back to the default value in the same way. This is best done with a pair of OnEnable/OnDisable functions:

    public float newRayLength = 100f;
    private float originalRayLength;
    
    void OnEnable ()
    {
        originalRayLength = AC.KickStarter.settingsManager.hotspotRaycastLength;
        AC.KickStarter.settingsManager.hotspotRaycastLength = newRayLength;
    }
    
    void OnDisable ()
    {
        AC.KickStarter.settingsManager.hotspotRaycastLength = originalRayLength;
    }
    

    Placing this code inside a new C# script that's attached to a scene object will override the Hotspot ray length for the duration of that scene.

  • thank you

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.