Godot

5925 readers
146 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

[email protected]

Credits

founded 1 year ago
MODERATORS
501
 
 

Since I'm currently dealing with this problem, I'm gonna leave this info here, so anyone that comes across it knows what to do to fix it. Currently working on 4.1.1, should work on 3.x too

This is a problem that happens if you rename or delete files outside the Godot editor. Godot may warn you, or it may simply keep a cached copy and keep you completely unaware of it until you export the game and try to play it. It's always a good thing to check for these once in a while.

Related questions:

HOW TO FIX:

  • Create a dummy file, it can be a.PNG or whatever
  • Open the problematic scenes with a text editor
  • Change the path of the offending files to the dummy. They're usually at the top of the file, loaded as [ext_resource type="Texture" uid="" path=res://graphics/missing.png" id="10_0y2mn"
  • After saving, try to load the scene again. Be sure to run the Debug console version of Godot
  • If everything went well, it should open. Delete the dummy file from within the editor.

If that doesn't work, try this instead:

  • Open the problematic scenes with a text editor
  • Remove any lines that point to the offending files.
  • Run the Godot with the debug console
  • Attempt to open the scene in the editor. If it gives an error, check the debug console, the most likely error will be something like res://scenes/problemscene.tscn:3815 - Parse Error: Can't load cached ext-resource id: 10_0y2mn
  • Back in the text editor, look for that id within the scene. It'll likely be something similar to texture = ExtResource("10_0y2mn"). Delete it
  • Repeat the last 2 steps until the errors stop.
502
 
 

I'm trying to use a tween to change the position of one of the points in a line2d, but I'm not sure what the syntax would be for this.

This is what I have: tween.tween_property(line, "points", target_position, time)

Obviously this doesn't work because points has more than one point to make the line. If I need index 1 of points specifically, how would I do that? Or do I have to address it as a whole PackedVector2Array?

EDIT: I found the answer to this in case anyone else stumbles across this. You use colons, like this:

tween.tween_property(line, "points:1, target_position, time)

503
 
 

I'm making a platformer, so when the player is facing the opposite direction, I just want to mirror the graphics. I've set up a whole Skeleton2D with Bones, then set up InverseKinematics to help animate it.

The problem is that I can't find a way to make the thing work when mirrored. Scaling the target IK doesn't work. Multiplying the IK position by -1 also doesn't work properly. It does change the target bone rotation, but the bone rotates in the reverse direction (it "pushes" the bone away).

The closest I got to get it to work properly is by applying a negative scale to the affected bone after scaling the skeleton to -1, but even then, the image flips back to the right side.

Right now, I'm starting to think I'll have to use the IKs to create the animations only as the means to key the bone positions, as I can't figure out a way to make a flipped animation with IK targets. So, once all bones are keyed into the animations, I can safely delete the IKs

To reproduce:

  • Make a Skeleton2D node, make 3 children Bone2D nodes, one being the parent of the other (B1 -> B2 -> B3)
  • Create a Node2D to use as IK target
  • On the Skeleton2D Inspector, add a new SkeletonModification and enable it
  • Add a new Element to the SkeletonModification, of type TwoBoneIK (third option, from the bottom up)
  • Joint Bone One = B2 (uppermost bone); Joint Bone Two = B3 (farthest most); Target = IK_Target
  • Move the target around to see if it's working properly.
  • Attempt to mirror it in a way that it doesn't break

TLDR - How do I horizontally flip a skeleton2D with IK without breaking the animations?

504
 
 

I feel like Godot's AnimationTree is significantly more valuable and useful than Unity's Animator component. You can nest your Statemacchins or blend trees or BlendSpace2Ds. You can attach scripts to individual Statemachine Transitions if you wanted.

You also have access to the Advance Expressions, which is a fantastic way to not have to manually set a billion bools

And you can actually manipulate all of this from code, something I detested about Unity was how locked out I felt from the Animator component, and the legacy animation system is beyond old and depreciated. Godot doesn't lock anything away and you can modify everything you want from code, if you need.

Curious if maybe I missed something with my time in Unity, but it made me frustrated and annoyed more than anything.

505
506
 
 

I'm just looking for a good review of modern large-scale terrain rendering techniques. I've been reading about a few individually, various quadtree stuff, GPU clipmaps, continuous methods, but I don't have a good grasp of the state of the art, performance comparisons between methods, what I should invest my time learning better etc. A well-written review article would help a lot. But I can't find much, at least not from the last few years. If there isn't a good academic article maybe someone wrote a great blog post or something? I get a lot of hits searching around but they are mostly zillions of different people implementing this or that algorithm for demo projects, it's harder to find systematically put together information giving an overview of the field and techniques.

507
508
18
10 Games Made in Godot (www.youtube.com)
submitted 1 year ago by mac to c/godot
509
510
511
512
513
25
submitted 1 year ago* (last edited 1 year ago) by ICastFist to c/godot
 
 

I made a pause menu, but there seems to be a "dead square" in the middle of the screen, where it doesn't detect the mouse hovering. The deadzone seems fixed in size and place, moving the menu out of the center makes the problem stop. So, something invisible on top?

Video showing the problem - https://files.catbox.moe/92kr8z.mp4

How the node is set up

The "OptionsWin" opens a new UI element, but moving it around doesn't change the deadzone, even if none of its elements are anywhere near the original pause menu.

Any ideas on how to fix this without having to offset the pause menu?

EDIT: Fix is my comment below. Should've tested it as an isolate scene first, that led me to looking into the player node and finding the problem. Hopefully this will help someone else in the future.

514
11
submitted 1 year ago* (last edited 1 year ago) by mac to c/godot
 
 

Pretty nice FPS game in godot. This progress was made in 2 weeks

515
14
I created a water shader (files.catbox.moe)
submitted 1 year ago by [email protected] to c/godot
 
 

So for fun I made a water shader. The waves are done using sum-of-sines (or rather sum of sin^8), im using the depth texture for opacity based on water depth and the screen texture to fake refraction.

The cool thing about sum of sines is that the waves are very configurable, you can also create flatter water or less detailed waves by just changing the shader properties, or even create a water stream with a single flow direction.

516
517
518
519
520
521
522
523
524
 
 

I'm trying to make a 3d flight controller with a more arcade feel (think Ace Combat or Rogue Squadron). I'm somewhat new to working in 3d in Godot though and I don't really understand what methods I should be using to achieve this.

I want up and down to control pitch and left and right to be something of a hybrid roll/yaw. I'm setting direction to -transform.basis.z and multiplying that by speed, but when I use rotate_x() with the pitch, the plane itself rotates, but I only move flatly across the world plane rather than climbing up or down as I'm attempting to achieve.

What am I missing here?

525
20
submitted 1 year ago by mac to c/godot
 
 

Post originally by Majestic_Mission1682 titled

I like how Hyper Light drifer hides its ui automatically. So i did that to my game.

view more: ‹ prev next ›