Skip to main content

New answers tagged

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-...
Engineer's user avatar
  • 30.2k
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 ...
Nabir14's user avatar
  • 43
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 ...
SlavaCat's user avatar
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 ...
Dragonforge Development's user avatar
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.
rogerdv's user avatar
  • 41
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 ...
Theraot's user avatar
  • 27.3k
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 : ...
buzzbuzz20xx's user avatar
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 ...
DavidT's user avatar
  • 631
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;
Marat's user avatar
  • 11

Top 50 recent answers are included