Forum rules - please read before posting.

[Bug?] ToggleRun doesn't persist between scenes

Unity 2019.2.2
AC 1.69.4

When switching to running using the ToggleRun button, going to another scene switches character to walking. I tried circumvent this by creating an active input asset where I would use constrain node to switch between running and walking, but the problem was still there.

Also, a side question - is it possible to set running as default and switch to walk when player presses ToggleRun button the first time?

Comments

  • After further testing it appears that restricting player to run only doesn't persist between scenes.

    Here's what is happening:
    I set character to only run in Start cutscene (no other cutscenes are present in the scene), after I go to another scene (does no contain any cutscenes at all) character reverts back to walking.

  • I looked into the code and I think I found the reason it's happening.

    PlayerInput script that is attached to the GameEngine has 2 variables: playerIsControlledRunning and toggleRun. Since PlayerInput is not set to be part of the PersistentEngine object switching the scenes results in both of those variables resetting to their default state which causes player to switch back to walking.

    I fixed it by setting those variables to be static.

  • Thanks for the feedback.

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.