Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Riri |
Hello! I want to make a tween move up and down ( this tween will be a trap and it’s moving up and down only on Y axis). The problem is that my node moves from up- to down and get back to its place (up) and stops. I want it to continuously move up and down. Do you know how to do it? I tried to use a timer but I didn’t succed.
export var move_to = Vector2.DOWN *600
export var speed = 6.0
var follow= Vector2.ZERO
onready var tween = $Tween
func _ready():
_init_tween()
func _physics_process(delta):
platform.position= platform.position.linear_interpolate(follow,0.075)
func _init_tween():
tween.interpolate_property(self,“follow”,move_to, Vector2.ZERO, 3, Tween.TRANS_LINEAR, Tween.EASE_IN_OUT, 2)
tween.start()
Can you edit your post and use the code sample tag (mark code, press the icon with “{ }”), to make it easier to read?
Becbunzen | 2020-06-02 17:53