this post was submitted on 07 Jun 2025
70 points (100.0% liked)

Godot

6717 readers
71 users here now

Welcome to the programming.dev Godot community!

This is a place where you can discuss about anything relating to the Godot game engine. Feel free to ask questions, post tutorials, show off your godot game, etc.

Make sure to follow the Godot CoC while chatting

We have a matrix room that can be used for chatting with other members of the community here

Links

Other Communities

Rules

We have a four strike system in this community where you get warned the first time you break a rule, then given a week ban, then given a year ban, then a permanent ban. Certain actions may bypass this and go straight to permanent ban if severe enough and done with malicious intent

Wormhole

!roguelikedev@programming.dev

Credits

founded 2 years ago
MODERATORS
 

godot-rust v0.3 brings type-safe signals to the table.
If you register a signal:

#[signal]
fn damage_taken(amount: i32);

you can now freely connect it with other Rust functions:

fn ready(&mut self) {
    // Connect signal to the method:
    self.signals().damage_taken().connect(Self::on_damage_taken);
    
    // Or to an ad-hoc closure:
    self.signals().damage_taken().connect(|amount| {
        println!("Damage taken: {}", amount);
    });
    
    // Or to a method of another object:
    let stats: Gd<Stats>;
    self.signals().damage_taken().connect_other(&stats, |stats, amount| {
        stats.update_total_damage(amount);
    });
}

Emitting is also type-safe:

self.signals().damage_taken().emit(42);

Furthermore, you can now await signals, effectively introducing async tasks:

godot::task::spawn(async move {
    godot_print!("Wait for damage to occur...");
    
    let (dmg,) = player.signals().damage_taken().to_future().await;
    godot_print!("Player took {dmg} damage.");
});

There are many other improvements, see devlog and feel free to ask me anything :)

Huge thanks to all the contributors who helped ship these features!

~this was originally posted by @bromeon@mastodon.gamedev.place the project author on reddit. I'm just maintaining some parts of the project.~

top 1 comments
sorted by: hot top controversial new old
[–] jerkface@lemmy.ca 3 points 18 hours ago

me of two years ago is so frigging psyched right now