Process Runs Every Frame
Part of the Nodes and Scenes section of Coddy's Godot journey. Lesson 7 of 27.
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 += 1That 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
EasyMake the robot slide right. Inside _process(), move it 2 pixels right on every frame.
Try it yourself
extends Node2D
func _process(delta):
pass
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Nodes and Scenes
1Your First Godot Game
What Is Godot?Ready Runs OncePrint in GodotThe Scene TreeSet a PositionMove a Node Once2Every Frame
Process Runs Every FrameDeltaPixels per SecondMove DiagonallySpin With RotationGrow With ScalePractice on your own: Godot playground