Thursday, August 7, 2025

Object Timers in GDevelop are a way to have a timer per object. On the other hand Scene Timers are timers which execute globally for the whole scene.

Object Timers are useful when certain objects in your game should incorporate a dedicated timer, for example for a cool-down effect, or self-destruct mechanic. 

But Object Timers in GDevelop are a bit tricky, because of how they are defined, and how GDevelop resolves to which object instances the timer applies. Take a look at this example:

The timer has to be created right after the object it relates to has been created. If you do it later, the connection between the two would not work as you would expect.

This is sth. that is not quite obvious from the official documentation:
https://wiki.gdevelop.io/gdevelop5/all-features/timers-and-time/#object-timers


Mega Man 9 jump in Godot

A while ago I tried to recreate the jump mechanic of Mega Man 9 in Godot. Here is what I came up with:
 
export (int) var jump_speed = -400
export (int) var gravity = 1200

var jumping = false

func _physics_process(delta):
    if Input.is_action_just_pressed('jump') and is_on_floor():
        jumping = true
        velocity.y = jump_speed

    if jumping and Input.is_action_just_released("jump"):
        if velocity.y < -50:
        velocity.y = -50

    velocity.y += gravity * delta

    velocity = move_and_slide(velocity, Vector2.UP)

    if jumping and is_on_floor():
        jumping = false

Source: https://ask.godotengine.org/26160/jump-godot-holding-button-higher-jump-tapping-100%25-same-height?show=74579#a74579

Object Timers in GDevelop are a way to have a timer per object. On the other hand Scene Timers are timers which execute globally for the who...