Copyright © 2025-2026 Candy ArtsCS Move
The CS_Move command moves nodes in the game world with movement code that you write. Candy Dialogue Engine can't know how your game moves its characters, such as along a path, with a navigation agent or with a tween, so it ships no movement of its own. Each movement is a script that you add to the Candy_DE/Scripts/Move_Events folder, and each target's Movement key names the script that moves it. The scripts you add to that folder are 'safe': updates never overwrite them.
For example, this Line walks the Hero node to the Door marker:
{"CS_Move": {"Targets": {"Actors/Hero": {"Movement": "Walk", "Data": "Pins/Door"}}}}CandyMoveEvent and declares one function, handle(). Its file name is the Movement value, which is Walk.gd in the example above. This script moves the node to the marker named by Data in two seconds, and delays the Dialogue until the node has arrived:
extends CandyMoveEvent
func handle(engine: CandyEngine, node: Node, data: Variant, _ctx: CandyContext, _custom_data: Array) -> String:
var marker := CandyCutscene.get_shared().resolve_target(engine, self, data, "CS_Move")
if marker == null:
return "Continue"
var tween := node.create_tween()
tween.tween_property(node, "global_position", marker.global_position, 2.0)
await tween.finished
return "Continue"| Argument | Value |
| engine | The Engine running the CS_Move command. |
| node | The target to move. The command has already resolved it. |
| data | The target's Data value. If it was written as an expression, it's already evaluated, so it can be any type of value. |
| ctx | The Line holding the CS_Move command, a CandyContext: conversation, block, line_index, line_data. |
| custom_data | The Custom Data of the Line and of the target, as [[line values], [target values]]. |
- handle() returns what the Dialogue does next, as a Command script does:
"Continue","Return"or"END". - Every target of a Line starts moving at the same time. The Dialogue continues once every script has returned.
- A script that uses
awaituntil its movement is over delays the Dialogue. A script that starts its movement and returns immediately leaves the Dialogue to continue while the node moves. - CandyCutscene.get_shared().resolve_target() resolves a node named as targets are, such as the marker in the example. It reports a node it can't find, and returns
null. - A Movement value with no script is reported, and that target doesn't move.