0 votes

I'm struggling to find how to change the game state with a signal. Or is there a better way?

I have a player character that I want to move freely till an enemy detects them. Then it should become turn based. Much like Fallout 1 or 2. The scene doesn't change, just the state of the players and NPCs.

Currently I have a player that moves, and enemies that roam freely. They can detect the player individually... but whats the best way to change everyones state? Or am I going about this wrong?

in Engine by (15 points)
edited by

1 Answer

0 votes

I'm no expert but the way I would do it is putting all the combat participants in an array in an autoload, have a function in the autoload that changes that state of all nodes in the array and since it's an autoload you can pretty much call that function from where ever you want. from the player or one of the character.

by (305 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.