Skip to reading
Visual Scripting in Depth

Appendix D. A target-aware text helper

Edition 0.86.4.3

0.86.4.3 edition with revised lessons, updated cross-references and new cinematic/camera-safety supplements. Earlier examples, screenshots and registry figures retain their stated edition context.

Download PDFView PDF page

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.

Code example
extends PCAScriptBase
Code example
func set_visible(target, visible):
    await SetObjectVisible({
        "entityId": target, "visible": visible
    })
    return visible
Source table from Appendix D. A target-aware text helper, page 77
Definition fieldValue
Function Name / Display Nameset_visible / Set Object Visibility
Parameter 1target; entity; default this
Parameter 2visible; bool; default true
ReturnThe 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.

Page 77 of 93Permalink
Go to page