Menu
CoddyTech

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 icon

Challenge

Easy

Make the robot spin while it glides.

  1. Keep both steps in the same 1 second.
  2. Put .parallel() on the second step, the spin, so it starts with the glide.

Press Play: the robot rolls onto the pad in one move. Then Check.

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)

All lessons in Game Feel

Practice on your own: Godot playground