At the Same Time
Part of the Game Feel section of Coddy's Godot journey. Lesson 6 of 23.
Some changes should happen together, like a coin that grows while it fades. parallel() makes the next step run at the same time as the step before it.
var tween = create_tween()
tween.tween_property(self, "scale", Vector2(2, 2), 0.5)
tween.parallel().tween_property(self, "modulate:a", 0.0, 0.5)The node grows and fades in the same half second. A step without parallel() waits for the step before it, as usual.
To run every step of a tween together, call tween.set_parallel() once after create_tween().
Challenge
EasyThe robot glides to the pad, then spins. Make it spin while it glides, both in the same 1 second.
Try it yourself
extends Node2D
func _ready():
var tween = create_tween()
tween.tween_property(self, "position", Vector2(480, 265), 1.0)
tween.tween_property(self, "rotation_degrees", 360.0, 1.0)
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Game Feel
1Tweens
Your First TweenTween Any PropertyFade OutEase OutOne After AnotherAt the Same TimeA Coin That PopsPractice on your own: Godot playground