Skip to content

StateMachine.Driver is null after unity hot code reload #47

@Relecto

Description

@Relecto

Hi!
So let's say I have a default state machine:

protected StateMachine<States> fsm;

and in Update() I call fsm.Driver.Update.Invoke();

void Update() {
    fsm.Driver.Update.Invoke();
}

It works well, but it looks like that Driver field is not preserved after a code reload while the game is running

NullReferenceException: Object reference not set to an instance of an object
QT.Entity.Update () (at Script.cs:137)

Is this an expected behaviour, or am I using it wrong?
If it is expected, is there a way we could preserve that field between reloads?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions