R10. Directed-opening helper sources
R10. Directed-opening helper sources
ivo.global_position = ivo_start.lerp(ivo_mark, fraction)
elias.global_position = elias_start.lerp(elias_mark, fraction)
await Runtime.get_tree().process_frame
seconds += Runtime.get_process_delta_time()
if not active(generation): return false
ivo.global_position = ivo_mark
elias.global_position = elias_mark
Runtime.face_character("ada", "elias")
Runtime.face_character("elias", "ada")
Runtime.set_character_state("ada", "handshake")
Runtime.set_character_state("elias", "handshake")
Runtime.set_meta("clockmaker_handshake_phase", "reach")
var linked: bool = false
var released: bool = false
seconds = 0.0
while seconds < 3.65 and active(generation):
if seconds >= 0.95 and not linked and not released:
var touching: bool = await AttachPointsTouching({"entityId":"ada",
"point":"right_hand_grip", "targetId":"elias", "targetPoint":"right_hand_grip",
"tolerance":0.012})
if touching:
linked = await AttachPoints({"entityId":"ada", "point":"right_hand_grip",
"targetId":"elias", "targetPoint":"right_hand_grip", "alignRotation":false,
"suspendMovement":true})
Runtime.set_meta("clockmaker_handshake_phase", "clasp")
elif seconds > 1.15:
released = true
Runtime.log_message("Handshake contact missed; keeping the authored animation without
snapping.")
if seconds >= 2.5 and not released:
await DetachObject({"entityId":"ada"})
released = true
Runtime.set_meta("clockmaker_handshake_phase", "release")
await Runtime.get_tree().process_frame seconds += Runtime.get_process_delta_time()
if Runtime.runtime_generation == generation:
await DetachObject({"entityId":"ada"})
Runtime.set_meta("clockmaker_handshake_phase", "finished")
return linked