Forum rules - please read before posting.

Switching Direct-movement type

Hello everyone,

I would like to change my direct movement type in-game from "relative to camera" to "tank controls" and vice versa using actionlist. is there an easy way to do that ?

Comments

  • Any Manager field can be modified at runtime through script - just right-click a field's label to get an API reference to it. In the case of Direct-movement type, this is:

    AC.KickStarter.settingsManager.directMovementType
    

    To set its value, create a C# script and add public functions that each set it to a specific value, i.e.:

    public void SetToTankControls ()
    {
        AC.KickStarter.settingsManager.directMovementType = DirectMovementType.TankControls;
    }
    
    public void SetToRelativeToCamera ()
    {
        AC.KickStarter.settingsManager.directMovementType = DirectMovementType.RelativeToCamera;
    }
    

    To run these functions, add the script to a GameObject, make it a prefab, and remove from the scene. You can then use the Object: Call event Action to reference the prefab and trigger the intended function.

    Just be aware that changes made to Manager field values will survive exiting Play mode - so you'll need to make sure its set correctly when your game begins. To do this, use another such Action in your game's ActionList when start game asset, which can be assigned at the top of the Settings Manager.

  • Works like a charm, 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.