/r/godot

Photograph via snooOG

The official subreddit for the Godot Engine. Meet your fellow game developers as well as engine contributors, stay up to date on Godot news, and share your projects and resources with each other. Maintained by the Godot Foundation, the non-profit taking good care of the Godot project - consider donating to https://fund.godotengine.org/ to keep us going!

Looking for Godot?

Download the engine, Donate to the fund, Follow us on socials & more! Official Link-Collection

Subreddit rules:

Apply to become a mod!

1. Follow the Code of Conduct Read it here Breaching the code is a banable offense. In particular, we won't tolerate discrimination or bullying of any kind.

2. Use appropriate flairs for your posts If you don't, we maintain the right to delete the post in violation of this rule.

3. Post memes with consideration They must have the "fun & memes" flair, be related to Game Development, and the topic/content cannot breach the Code of Conduct. Do not spam memes.

4. Promotion only under certain circumstances To avoid plain advertisments to an audience of game developers, we offer a handful of themed promotion flairs, so you can show off your game with purpose instead - if your post idea does not fit any of them, please reconsider posting. Additionally, we require posters in this flair category to stay active and respond to comments under their promotion - otherwise we may delete the post.

5. Stay on topic This is a subreddit about the Godot Engine. While related Game Development topics are not forbidden, please make sure to tailor them towards the Godot project. This means no art posts unless you are talking about the technical side of things - there are enough other outlets to post your pretty renders and concepts.

6. Getting started Reference this starter guide before asking for general advice/help. Posts asking "Where do I start?" will automatically be locked, due to this subreddit overflowing with them in the past.

7. Tech Support guidelines Repeated neglect of these can be a bannable offense. 1 - Consult the docs first 2 - Check for duplicates before writing your own post 3 - Concrete questions/issues only! This is not the place to vaguely ask "How to make X" before doing your own research. 4 - Post code snippets directly & formatted as such (or use a pastebin), not as pictures 5 - Additionally it is strongly recommended to check out the official forum for solutions first.

/r/godot

185,533 Subscribers

1

Hide function names inside Animation Player?

Hey. When you call the same function multiple times inside the Animation timeline, it can look really messy (especially if the function has a large name, or arguments). Is there a way to hide this?

This is what I'm referring to

1 Comment
2024/05/17
00:11 UTC

1

Good fundamentals tutorial for 3.5.2 C# 2D?

This is a fairly specific set of crtieria, but I really just need a fundamental guide to help me learn the intricacies of how Godot things work, I am a proficient coder and good at looking for my own solutions, but getting started is incredibly hard without good fundamental knowledge.

0 Comments
2024/05/17
00:00 UTC

1

Parallelizing asymmetric sequential tweens?

Okay, I have tween sequence A that consists of A1 and A2. I also have Tween sequence B that consists of B1, B2, and B3.

The durations A and B are identical and I want to run them both in parallel. I am sure I'm missing something obvious, any boilerplate code I can be pointed to?

1 Comment
2024/05/16
23:58 UTC

1

Added a new ship to my game!

Looking for feedback on the visual design. https://youtu.be/j0R8IIrA_a0

0 Comments
2024/05/16
23:37 UTC

1

Minimalist GUI for headless server?

Hi,

I'm wondering what the best way to create something similar to the Minecraft server GUI is for Godot. Currently I have a headless server that I can start from the terminal to see print statements, but that's about it.

https://preview.redd.it/f13ildeqhv0d1.png?width=1097&format=png&auto=webp&s=d729e0c5bdcea6c4892067c9bf6c585fb57b96d4

3 Comments
2024/05/16
23:29 UTC

4

Attempt number 2 at making a trailer for my game.

3 Comments
2024/05/16
23:27 UTC

1

Broken rendering with Web Exports

Recently I've been trying to export my game to Web just for fun, even if I'm targeting desktop, (I'm on 4.2),

But to my surprise the graphics are completely broken, transparency effects don't work, BackBufferCopy seemingly doesn't work. Everything is extremely dark. It's a massive difference that I don't see talked about a lot.

Sure C# is broken for web and there's the audio stuff. But 3D rendering is 100% super broken, or am I alone in experiencing this?

3 Comments
2024/05/16
23:20 UTC

1

GUI for FACS addon

still working on it for adding, but when it's done i should be able to let the user use blocks and chain them to create animation functions instead of simply coding it by hand, so it can be more user-friendly when figuring out the format for how it handles things.

https://reddit.com/link/1ctqdyf/video/hdouuzl1cv0d1/player

0 Comments
2024/05/16
22:55 UTC

1

Extremely weird end of file corruption bug

Can you explain this weird bug?

I write text to file.

But if i spam my "rename substring inside file" function,

func __replace(file_name: String, new_text: String, old_text: String) -> void:

  var path: String = FileSystemUtils.USER_PATH + file_name
  var save_file: FileAccess = FileAccess.open(path, FileAccess.READ_WRITE)

  var content: String = save_file.get_as_text()
  content = content.replace(old_text, new_text)

  save_file.store_line(content)

the file gets corrupted in a weird way.

This is what my end of file is supposed to look like (one line):

"dark"}}$$$

This is what it ends up looking like instead:

"dark"}}$$$
$$
"}}$$$

or

"dark"}}$$$


$$
$$

or

"dark"}}$$$


"}}$$$

or

"dark"}}$$$
$$
$$

or

"dark"}}$$$
$
$$ 

Seems multiple lines get added to end of file, each duplicating last few original characters... 0, 1, 2 or 6 characters?

Each of the 5 examples above was the result of starting with original string (supposed to look like), then applying the __replace function a random number of times very quickly (mouse click on button that emits a signal that calls __replace).

The original contents of the file are not corrupted, only the end of file gets appended junk. So, I can "un-corrupt" the file by keeping only the first line and discarding all new lines after it.

If i spam my button "slowly", there is no corruption.

Is this some kind of weird race condition in Godot's FileAccess ?

I'm using Godo Stable 4.2.1

5 Comments
2024/05/16
22:40 UTC

1

Scraping data with modifiers from resources

Hey!

I'm trying to figure something out that I've never been able to wrap my head around:

I have a unit. It has a skill of 5 to attack something. I want to get it's modifier for a specific check, so I would naturally use a function to get that unit, then a function to get it's skill score.

If I give this unit a trait, something like the sword it's using giving it an attack bonus of +2, how would I query that unit to get that bonus working?

The result I'd want is being able to check the units basic skill, then being able to pull together everything modifying this value before getting the sum of those things, example below:

Team Request: Group Stealth check.

  • Unit 1 gives its speed of 2.
  • Unit 2 gives its speed of 5.
  • Unit 3 gives its speed of 7, while also having a feature that gives it a stealth bonus of 4, so in this situation it'll return 11.

Team receives a total stealth score of 18 (2 +5 +11) instead of 14.

4 Comments
2024/05/16
22:24 UTC

1

My OctTree system in Godot

https://reddit.com/link/1ctpntw/video/d90cmi1z4v0d1/player

It's while which I work on an OctTree system in Godot! basically my octtree receive a bunch of points in space with their corresponding integer ids! and it calculate their LODs, the points which are closer to the camera are has lower lod!

Also it will tell only which points has been changed! if a point LOD does not change it don't need any update!

The Good thing about OctTree it does this JOB really fast! it can calculate the LOD of millions of points in space less than a 1ms!

This can be base for many other system as you can see in above video I have created a OctMesh which can be replaced with MeshInstance3d which also handle custom LOD mesh!

I will put this on top of my terrain plugin, because in terrain plugin (MTerrain) also we need this system for future

0 Comments
2024/05/16
22:22 UTC

1

Help! There is something wrong with my script

3 Comments
2024/05/16
22:08 UTC

1

How to quickly color/ fill in a CollisionPolygon?

Right now, I'm just stretching sprites to fill in the collision polygons that I'm making (I'm using the collision polygons for the ground in a 2D game). I figure that there must be a more efficient way of doing this, maybe an add-on I don't know about? It doesn't have to look too great, I'm just prototyping

3 Comments
2024/05/16
22:01 UTC

3

Issues with NPC Pathfinding

Working on pathfinding for my game. Going for a Rimworld / Prison Architect style management game. Having an issue seen in the attached video, where the npc runs into walls rather than around them. The npc has a sprite, collider, and NavigationAgent2D. The grass in the tilemap is on layer 0, the water / placed wall (in the future) is on layer 1. As seen the npc collides with walls as expected, but doesn't seem to recognize their existence and doesn't go around. I'm thinking it has something to do with the layers in the tilemap, as the navigation layer is on layer 0 not 1 where the colliders are for the wall. I am good with programming (About to graduate with a CS degree) but am new to Godot (Started 2 days ago) so all of the Godot and gdscript stuff is new to me. I have also uploaded the scripts to pastebin: Click for code

Video that shows how the NPC doesn't recognize the wall.

1 Comment
2024/05/16
21:47 UTC

1

Help with flickering on model in Godot 4.22

3 Comments
2024/05/16
21:45 UTC

1

Clash of Clans like pathfinding

I'm making a game with tower defense elements where the player can place walls and enemies path find around them with a NavigationAgent2D. Currently if the enemies are completely blocked off by walls they will just sit at the edge of them. I'm wondering if anyone knows how to get them to target a wall if they're blocked off or the distance of their path is longer than a set amount, kind of how it works in clash of clans. If anyone has any advice or search terms to help me accomplish this it would be greatly appreciated! Thank you.

6 Comments
2024/05/16
21:24 UTC

1

Add some polish and impact to your game!

I got some feedback on my game's shooting and how it wasn't super satisfying, which I definitely agreed with. So, I put together a quick video (tutorial of sorts?) on adding some polish to my game I've been making in Godot. Hopefully, this helps someone out there or gives some ideas. I could always use honest feedback, help, and ideas as well. Thanks

https://youtu.be/HaLosyMVRzs

0 Comments
2024/05/16
21:01 UTC

3

I promise this feature serves a purpose :)

0 Comments
2024/05/16
20:56 UTC

1

walk animations look sassy with reptilian legs

0 Comments
2024/05/16
20:55 UTC

1

How can I pass variables to a server on connection

I have an Authentication Server that sends a token to the game server and the client if the authentication is successful. And I want to make it so that the client uses that variable to connect to the game server and the game server checks if the token matches the token it was sent. How can I implement that?

1 Comment
2024/05/16
20:35 UTC

27

How can i mimic this via a shader?

I am struggling with shaders recently, I just what wo change the hue to make something like this happen.

Any help is welcome 😁

7 Comments
2024/05/16
20:28 UTC

1

Why is my shadow a box instead of cylinder?

Following the standard 3D game tutorial here:
https://docs.godotengine.org/en/stable/getting_started/first_3d_game/index.html

See the screenshot - the shadow of the player character is like a square instead of a circle.
What dictates this shape?

I've tried different renderers, played with the 3D camera settings (near/far/size) and I can't figure out exactly what's going on. But if I lower the size of the camera to say "9", it shows a circle as expected.

But if I go back to my original size (in this case 19), it turns back into a square.

In other words, camera comes further away from the player, the shadow turns into a box as a means to lower performance cost I assume?

But is there no other way to control this? I don't know how to achieve a non-boxy shadow with my preferred level of zoom onto the playing canvas.

https://preview.redd.it/1cfarrx8ku0d1.png?width=381&format=png&auto=webp&s=094c74051c7c62fe7657da5fe3d0d9056c2c8a74

3 Comments
2024/05/16
20:27 UTC

1

Activating entities when close

When designing a game with a large map, it is common practice to activate entities only when they are in the proximity of the player character. I started working on a 2D platform game using tilemaps and other entities on top but it looks like everything is permanently on. Is there a built in mechanism in Godot to activate things only when the player moves in a close boundary?

4 Comments
2024/05/16
20:02 UTC

5

How to Custom Spawn with MultiplayerSpawner???

3 Comments
2024/05/16
19:43 UTC

7

Progres showcase of my mobile slasher (+PC Vulkan)

0 Comments
2024/05/16
19:40 UTC

6

Terraria-like project I'm currently working on

2 Comments
2024/05/16
19:36 UTC

0

Global Resources in C# don't work

Here's the class:

using Godot;

[Tool]
[GlobalClass]
public class EntityDefinition : Resource
{
	[ExportGroup("Visuals")]
	[Export]
	public AtlasTexture texture;
	[Export]
	public Color color = Colors.White;
}

I've rebooted everything, no luck. Never shows up in custom resources.

On a related note: What is really the purpose of a definition class? The tutorial basically just uses it to export fields into the Godot GUI, and then copy their info into some other object. But that seems like a really dumb way to edit or compare a bunch of data when a table does pretty much everything better. Am I better off storing this in a JSON and deserializing, or am I missing the point of a Resource class?

5 Comments
2024/05/16
19:14 UTC

37

NORMORD wip4

13 Comments
2024/05/16
19:02 UTC

2

Failed to unload assemblies - Godot c#

Whenever I add or remove an `[Export]` and then rebuild the project, I get this error
``` .NET: Failed to unload assemblies. Please check https://github.com/godotengine/godot/issues/78513 for more information```.

It then asks me to reload the editor. I've searched online for multiple solutions but nothing.

Also, Godot doesn't support `Generics` in `C#`? Like that is super basic. I get errors that an item with the same key has already been added whenever I introduce Generics

2 Comments
2024/05/16
18:31 UTC

Back To Top