68. A complete script to enable the hand effect
Create an enabled GDScript record named Enable Hand Effect, ID effect_on. Keep it non-global with no automatic event subscriptions, then call it from the button or interaction you choose.
extends PCAScriptBasefunc run() -> void:
var linked: bool = await AttachParticleEffect({
"entityId":"hand_orb", "targetId":"player",
"targetPoint":"right_hand_grip", "offset":[0,0.04,0]
})
if not linked:
return
await SetObjectVisible({"entityId":"hand_orb","visible":true})
await ChangeObjectProperty({"entityId":"hand_orb",
"property":"particle.enabled","value":false})
await ChangeObjectProperty({"entityId":"hand_orb",
"property":"particle.enabled","value":true})The script first checks that the attachment succeeded. It then makes the source visible and restarts its emission. This handles an effect that was previously hidden or used once already.
Replace the IDs and point name with your own. The player alias follows the currently active player; an explicit ada target always requests that live instance. The example requires the emitter and target to exist in the same loaded room.
This is project script code using PCAScriptBase. It belongs in a script record, not in the engine source or a shader source file.
