# motion_event_visibility_test —— 40250 CHARACTER_SHOW/HIDE local consumer. extends SceneTree const GameScene = preload("res://game_scene.gd") class Actor extends Node3D: var hidden := false func set_motion_hidden(value: bool) -> void: hidden = value func is_motion_hidden() -> bool: return hidden var failures := 0 func check(ok: bool, label: String) -> void: if not ok: failures += 1 printerr("FAIL: " + label) func _init() -> void: call_deferred("run") func run() -> void: var game := GameScene.new() var actor := Actor.new() get_root().add_child(game) get_root().add_child(actor) game.player = actor game._on_local_motion_event_detailed({"type": 8, "sound": "", "pos": Vector3.ZERO}) check(actor.hidden, "CHARACTER_HIDE reaches the local actor") game._on_local_motion_event_detailed({"type": 7, "sound": "", "pos": Vector3.ZERO}) check(not actor.hidden, "CHARACTER_SHOW restores the local actor") game.free() actor.free() await process_frame if failures == 0: print("PASS: motion_event_visibility_test") quit(1 if failures else 0)