20 lines
521 B
GDScript
20 lines
521 B
GDScript
extends Node3D
|
|
|
|
var delta := 1.0 / float(Engine.physics_ticks_per_second)
|
|
|
|
func _ready():
|
|
Engine.get_physics_frames()
|
|
TAS_System.FrameIncremented.connect(frame_inc)
|
|
TAS_System.FramesAdvanced.connect(frames_change)
|
|
TAS_System.FramesRegressed.connect(frames_change)
|
|
|
|
func frame_inc(frame: int):
|
|
%AnimationTree.advance(delta)
|
|
|
|
func frames_change(start: int, end: int):
|
|
%AnimationTree.advance((end - start)*delta)
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta):
|
|
pass
|