10. Understand what Run Script tests
Run Script is a convenient quick test. It starts the embedded preview if necessary, selects Play and calls the selected script with a Use verb and an editor-test context. It is useful for checking a message or a small calculation.
| Test | What it proves |
|---|---|
| Run Script on first_message | The graph can start and reach the message with Use. |
| Use on an actual switch | The switch’s event assignment, selected verb and graph work together. |
| Pick Up on the key | The Take entry and the key’s Take action agree. |
| A real trigger entry | The correct actor entered the correct trigger and supplied its context. |
| A GUI button in Play | The runtime click event, target script and GUI context are correct. |
A Take-only On Interact graph can appear to do nothing under Run Script, because that quick test supplies Use. A script using this can also fail there because the editor call has no owning scene object.
1. Use Run Script first for an owner-independent chain.
2. Assign the graph to the real event.
3. Restart Play or Test Scene after changing authoring data.
4. Perform the actual interaction with the actual verb.
5. Check the visible outcome and the saved state, not only the absence of an error.
An already-running preview can retain its earlier project snapshot and runtime variables. A fresh restart is the reliable way to test a changed graph against its intended starting state.
