![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Gabriel |
Hi, I’m implementing a moving platform that follows a Path2d curve. The movement per se is controlled by a Tween node, like this:
extends Node2D
onready var follow = $Path2D/PathFollow2D
onready var tween = $Tween
export (int) var idle_duration = 1
export (int) var interpolation_duration = 6
func _ready():
tween.interpolate_property(follow, "unit_offset", 0, 1, interpolation_duration,
Tween.TRANS_SINE, Tween.EASE_IN_OUT, idle_duration)
tween.start()
By using exported variables I make each platform instantiated on the stage have different speeds, and idle times. But I can’t figure out how to easily export the “Tween.TRANS_SINE” part so that I can also change the TransitionType.
One thing that I thought was to recreate the TransitionType enum and set it to the exported var, but that does not sound like a good solution. I’d like to use the enum that is already there. Any ideas?
Thanks in advance.