Appendix D. A target-aware text helper
This GDScript helper is useful when a GUI or other caller needs to choose an explicit scene target. It also accepts the caller through an entity-typed parameter.
extends PCAScriptBasefunc set_visible(target, visible):
await SetObjectVisible({
"entityId": target, "visible": visible
})
return visible| Definition field | Value |
|---|---|
| Function Name / Display Name | set_visible / Set Object Visibility |
| Parameter 1 | target; entity; default this |
| Parameter 2 | visible; bool; default true |
| Return | The requested Boolean visibility value. |
1. Expose the function and apply/save its source.
2. Call it through Call Script Function.
3. For an object event, target can be this.
4. For a GUI event, enter the actual scene object ID instead of the GUI owner.
5. Set visible to false and test that only the intended target changes.
The target must exist in the applicable live room. This helper makes the target explicit; it does not create a missing entity or load another room’s model.
