Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Relecto opened this issue Nov 26, 2023 · 0 comments
Open

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

Relecto opened this issue Nov 26, 2023 · 0 comments

Comments

@Relecto
Copy link

Relecto commented Nov 26, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant