Menu
CoddyTech

Process Runs Every Frame

Part of the Nodes and Scenes section of Coddy's Godot journey. Lesson 7 of 28.

Godot draws a new picture of the game many times a second. Each picture is a frame. This game runs at 60 frames a second.

_ready() runs once. _process() runs on every frame, so 60 times a second:

func _process(delta):
	position.y += 1

That moves the node 1 pixel down on every frame, so 60 pixels each second. The steps are tiny, so you see a smooth slide.

Leave delta in the brackets for now. The next lesson explains it.

challenge icon

Challenge

Easy

Make the robot slide right.

  1. In _process(), replace pass with a line that adds 2 to position.x.
  2. Keep the tab in front of it.

Press Play: the robot slides off to the right, 2 pixels every frame. Then Check.

Try it yourself

extends Node2D

func _process(delta):
	pass

All lessons in Nodes and Scenes

Practice on your own: Godot playground