New answers tagged godot-4
0
votes
How to add water material below sea level in procedural terrain?
Divide your map into an NxN grid of cells. Resolution is up to you.
Check at sea level height whether you are above or below the terrain at this [x,y] (or [x,z]) point (will require some point-...
0
votes
Accepted
How to start animation only when a specific keymap is triggered?
There was a logic error. As I added left mouse button to trigger the animation. Since "mouse from touch" was enabled in mobile the "openLevel" keymap would automatically trigger ...
0
votes
Custom signal does not work in pause menu
Have you checked if _input() itself is being called? Sometimes overlaying nodes can consume inputs. Thats's all I can see based on what you've given, more information about your scene configuration ...
1
vote
Godot 4 Static Storage Handling
TLDR: Use OOP and let Godot handle data storage. You focus on your game.
Everything I've read since Godot 4 was released suggests that JSON serialization is no longer the way to go, especially for ...
2
votes
How to start animation only when a specific keymap is triggered?
The first thing that comes to my mind is that you have the animation configured as Autoplay and loop. The second, some logic error in the code that triggers openLevel at the wrong time.
0
votes
Setting up AI Pathing in Godot 4.3, NPC not moving but it is updating the pathing correctly
I suspect you forgot to connect _on_velocity_computed to the velocity_computed signal. To be clear, there isn't a ...
0
votes
CharacterBody2D knockback not being applied in the correct direction
Okay as I was falling asleep last night the solution clicked in my mind XD
and a user gave me a much better way to simplify the code too, here's the working code :
...
0
votes
Godot 4 Static Storage Handling
The key point behind your question was that you didn't want to manage metadata in JSON files. Out of the box Godot gives you two (related) alternatives:
Create objects in a supported scripting ...
1
vote
Accepted
Translate global position into screen position taking into account camera zoom
Solution is to multiply found offset by zoom:
(placePosition - _camera.GlobalPosition) * _camera.Zoom + GetViewportRect().Size / 2f;
Top 50 recent answers are included
Related Tags
godot-4 × 168godot × 83
gdscript × 44
c# × 12
2d × 12
physics × 8
shaders × 7
tilemap × 6
gui × 6
c++ × 5
collision-detection × 5
textures × 5
animation × 5
3d × 4
mathematics × 4
rotation × 4
movement × 4
html5 × 4
navmesh × 4
sprites × 3
procedural-generation × 3
platformer × 3
isometric × 3
fragment-shader × 3
mesh × 3