Godot

6704 readers
38 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
1
 
 

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.~

2
3
 
 

Hi everybody. Let's continue our series on modeling 3D scenes using shaders and raymarching technology. In the previous fourth part, we managed to render the scene from any position and at any angle, which is very useful in itself, but we were still rendering each object in the same monotonous color. This time, we'll fix that detail and rewrite our code so that we can assign a different material to each object.

4
 
 

Hi everyone! I think every shader developer has at some point found themselves in a situation where they needed to determine certain values in the fragment function, especially when the shader wasn't behaving as expected. The problem is that the shader runs on the GPU, so we don't have anything like an output console available. So, how can we solve that? There are some options, and I’ll demonstrate one of them in this tutorial.

5
6
 
 

Hi everyone! We've already had a spiral tunnel, a circular tunnel, and a triangular tunnel. How about trying a square or rectangular one this time, which could resemble a classic dungeon-style game? It's pretty simple, so let's get to it.

7
 
 

Many people asked for it, so I created and released a new product: 80 shaders from my collection, ready to use in any project. Plus bonuses. 😎

8
 
 

I won't be able to make it, sadly, but maybe someone here is interested and hadn't heard of it yet.

9
10
 
 

Hi everybody. You might remember that the fire effect created using particles in Godot 4 was one of the first tutorials I published on this channel. Since then, more than a year has passed, the Godot Engine has evolved a lot, and many things have changed in the editor as well, so the original video is no longer very usable with the latest version of Godot (currently 4.4). That's why I decided to create a new, up-to-date, and improved tutorial, which we're about to dive into.

11
12
 
 

Junkyard Space Agency is an upcoming co-op space agency simulator that the developer said is like a "scrappier, multiplayer version" of Kerbal Space Program. It's being made with Godot Engine

13
 
 

Hey everybody! Let's go back to two dimensions, and take a look at how to create the effect you're currently seeing in the background of this video. It's basically something like a kaleidoscope, for which we need a source image and parameters like the number of segments, or the rotation speed. So let's go ahead and program this shader.

14
15
16
17
 
 

Hey everyone! This time, we'll be playing with fire. It's not the first time I've created a fire shader, but back then, I used a noise texture and a curve as a parameter, which significantly simplified the whole process. Now, we'll try it without such tools and generate a candle flame, which, as always, will have plenty of parameters for further adjustments. So let's get to it.

18
 
 

A few days ago, I saw a post on Reddit that inspired me to create a new local multiplayer game for me and my friends. After some late-night coding sessions, I’m excited to share Horse Race: a chaotic, fast-paced game perfect for game nights (or even solo play).

How it works:

Each horse is assigned to a specific button: the button you press to join the race. Your button is your key to controlling your horse throughout the race:

Attacking Opponents: to attack an opponent, simply press your button when you're in front of them.

Changing Direction: to adjust your horse's direction, press and release your button.

I’d love for you to try it out and share your thoughts. Any feedback or suggestions are more than welcome. Let me know what you’d like to see added or improved.

Play embedded here: https://stesproject.itch.io/horse-race

Have fun!

19
20
21
22
 
 

Hey y'all, I'm here from reddit after getting falsely permanent banned and I'm wondering if the community is good?

23
 
 

Some objects sticks with each other when those use CharacterBody2D, and moves like those are sticking together.

So, what do I need to do to solve this issue?

24
9
submitted 1 month ago* (last edited 1 month ago) by xolatgames@programming.dev to c/godot@programming.dev
 
 

Hi, folks! So, I have the problem with making materials as unique.

Image

I need effects, such as painting of ships in red color, will applies only where particles will spawns. But... As you can see those effects can applies also into other ships.

I've already set these materials as "Local to Scene" into inspector tab.

And have create script for making those materials as unique:

func _make_ship_materials_unique() -> void:
	for i in ship.get_children():
		if i is MeshInstance3D:
			for n in range(i.get_surface_override_material_count()):
				i.mesh.surface_set_material(n, i.mesh.surface_get_material(n).duplicate(true))

But it given me few results 😕

If it can help, here's the script of applying of ships painting:

func damaged_spec_effect() -> void:
	for i in ship.get_children():
		if i is MeshInstance3D:
			for n in range(i.get_surface_override_material_count()):
				_create_fade_in_then_out_effect(i.mesh.surface_get_material(n), Color.RED)
func _create_fade_in_then_out_effect(material: Material, final_color: Color) -> void:
	if material is StandardMaterial3D:
		material.albedo_color = Color.WHITE
		var tween = get_tree().create_tween()
		tween.tween_property(material, "albedo_color", final_color, EFFECTS_DURATION / 2)
		tween.tween_property(material, "albedo_color", Color.WHITE, EFFECTS_DURATION / 2)

So, what do I need to do for solving my problem? 🤔

25
 
 

Hey everybody! Recently, we created a shader that simulated an analog clock using polar coordinates, and we'll stick with this type of display a little longer. This time, I'll demonstrate how to program a fully customizable spinner based on similar principles. So, let's start coding!

view more: next ›