Questions tagged [godot-4]
The godot-4 tag has no usage guidance.
101
questions
0
votes
0
answers
39
views
Im trying o make snap in Godot. How do I get ~100 frames for one sprite(the card)?
How do I get a sprite with ~100 frames that can be changed with a script in Godot.
I am new to Game development.
0
votes
0
answers
46
views
Pixel platformer character collides with blocks above while there's still a visible gap
I was trying to the set up a tile map for a 2D pixel art game in Godot 4.1 (following a tutorial) and realized that there seems to be an issue or something I am not aware of with the way collisions ...
0
votes
0
answers
31
views
Using 3D Rotation track animations in the AnimationPlayer in Godot
Godot v4.1.2.stable
My goal is to make DirectionalLight3D rotate 360° around the scene, and in a second animation change the angle of rotation every 180 rotations between 75° and 30° on the X axis (a ...
1
vote
2
answers
410
views
Simple Circuit System
I want to make a simple circuit system in Godot. Here's what I mean by that. (The circuit isn't realistic)
I just want a battery object and a ...
1
vote
1
answer
67
views
Actual Custom Nodes in Godot
So I am creating a plugin for Godot 4, and I want to create an actual custom node.
What do I mean by that?
First to create a custom node I do:
...
0
votes
0
answers
59
views
Curves in Godot 4
I'm trying to figure out how to use curves to ease variable values in Godot 4.
Ok, I've created a curve like this:
@export var test_curve: Curve
I set up my curve ...
2
votes
1
answer
84
views
How to make redirected player movement respond to same key?
I have a 2d game (Godot 4) with different rooms with portals to go between them, and some portals redirect the direction of the player while still holding the same key. I have that working so far, but ...
0
votes
1
answer
92
views
"Springy legs" for a First Person Controller in Godot 4
I'm a total beginner, so I barely know what I'm doing, but here goes: I'm using this First Person Starter template and I would like to add a "springy legs" feature on character landing. The ...
5
votes
1
answer
114
views
How to get consistent collision impulse values for colliding rigid bodies in Godot?
I'm writing a game where you can pick and throw objects and depending on the force of the impact they break.
Using the get_contact_impulse method to calculate the breaking point gives me very ...
1
vote
1
answer
32
views
Prevent color adjustment in ViewportTexture
In Godot 4.1.1, I'm trying to use ViewportTextures to capture values generated by some shaders for use in another shader. One SubViewport is capturing the result of an unshaded spatial shader on a ...
0
votes
1
answer
51
views
When I inherit my own GDExtension class, editor can no longer see the inheriting class
I had two classes in my game, Player and ShootableObject. Both set up as such:
...
1
vote
1
answer
81
views
How to use the godot::String % operator for string formating of multiple values?
I tried this:
godot::String str = "values: %f,%f";
double a = 1.0;
double b = 2.0;
str = str % a % b;
Result string is:
...
3
votes
1
answer
68
views
How to make a CharacterBody2D slide out of StaticBody2D instead of teleporting?
I am trying to replicate Mario Maker's On/Off switches in Godot 4.1.
In my current version, if the player got stuck inside the block after it was toggled on, the player just teleports out it. I know ...
2
votes
1
answer
91
views
Why does find_child not work during _ready, but looping over child nodes finds the child?
I have been trying to split a game object in half, starting with splitting the collision shape in half. I create two new clones of the split object, then give them a property to be assigned to the ...
0
votes
1
answer
51
views
change_scene_to_file successfully transitions scene, then transports back to the previous scene
I'm having a problem with change_scene_to_file in Godot 4. For some reason
after the scene transition succeeded, I was automatically transported back the previous ...
2
votes
0
answers
94
views
How to make a callable type safe?
I can write a function like this:
func foo(someCallableThatShouldReturnBool: Callable):
if someCallableThatShouldReturnBool.call(): # do something
...
0
votes
1
answer
133
views
How to check if a point is on the navmesh?
How do I know if a node is in within a navigation rectangle?
I am working on an enemy spawner that puts enemies off screen but I need to pick positions where the enemies will actually work (read: on a ...
0
votes
1
answer
33
views
Move player at godot4
I designed a character that has 4 walking modes for godot4.
I saved the picture in PNG format.
I enter it into the animation section. When I set the keyframes and play, in addition to playing the ...
1
vote
1
answer
72
views
Scene Doesn't Change After Animation Complete
I'm encountering an issue in Godot 4 with my 2D character where the "Hurt" animation plays correctly when the character's health reaches 0, but the scene does not change as expected. Here's ...
1
vote
1
answer
72
views
Random display of a character in Godot 4
I made a character in Godot 4 that enters from one side of the image and exits from the other side, which shows its different modes randomly each time.
I have written these codes for it:
...
0
votes
1
answer
89
views
How to code glider movement in 2D? (Godot 4)
So in Minecraft, you have the elytra. When you look up, the character moves up. When you look down, the character moves down. The speed you move forward depends on the angle you are moving. I want to ...
0
votes
0
answers
55
views
Google Ads in HTML5 Godot 4 game that is embedded Electron chromium browser and that runs on localhost http server
Hi Google Ads shows ads on domain not localhost. But my game that is embedded in Electron browser and runs on htpp server on loaclhost (local html file). I want to show ads from localhost server. But ...
1
vote
1
answer
252
views
Collision in space between two characterbody3d
I have a characterbody3d that acts as a spaceship that I have temporarily given movement using the keyboard and then I have a characterbody3d that acts as a player that I have placed inside the ship, ...
3
votes
1
answer
167
views
What's the correct way to use NavigationAgent3D in Godot?
I've just started using Godot and obviously fail to use NavigationAgent3D correctly. I've added a NavigationRegion and baked a ...
0
votes
0
answers
88
views
How to drag and drop complex objects (with multilayered textures and text) in Godot?
Newbie to Godot here. My idea is to create a deck building game, inspired by Slay The Spire or Across the Obelisk. I have come to a problem that I can not seem to find the answer.
So, the card object ...
0
votes
2
answers
350
views
How to get nested child node without using full path in Godot?
How to get nested child node without using full path? I tried with just node name, it doesn't work.
The script is on top level so the path is quite long:
...
0
votes
1
answer
158
views
How do I make a 3D cursor that follows the mouse in Godot?
I want to position a 3D object at my mouse cursor. How can I do that in Godot? In Unity, I'd use
Camera.ScreenToWorldPoint.
1
vote
0
answers
161
views
Dialogue Manager Godot 4 Signals
When using the Dialogue Manager addon on Godot, I am trying to run a function to change the sprite of a character. My function look like this under my character script:
...
4
votes
2
answers
182
views
How would I mask the player node out of a canvas shader?
I'm making a 3D game, and I want to create a post processing effect using a canvasitem and a colorrect, that effects everything on screen apart from the player. I already have the shader itself made, ...
1
vote
1
answer
117
views
Raycast suspension simulation rebounds car on landing
I'm expecting the car to land and engage the suspension to dampen the landing. The code I'm using currently has this effect:
...
1
vote
1
answer
64
views
How do I remove the gap in a Godot HBoxContainer between items?
I created a HBoxContainer and put two ViewportContainers into it.
They line up side by side, but there is a gap of a couple of pixels between them.
How do I tell Godot that I don't want any spacing/...
1
vote
0
answers
87
views
Procedural NavigationPolygon for a platformer in Godot 4
I'm trying to make navigation possible for npcs in a 2D platformer.
The game generates chunks with random platforms as the player ascends, so I also need to implement the navigation procedurally.
Each ...
3
votes
1
answer
486
views
How do I instantiate a scene and change properties on it in C#?
Using Godot 4, following a tutorial but the tutorial is in GDScript. It is hard to find one for C# so I am trying to convert it as I go.
I made a scene called Coin and I have a scene called Main which ...
3
votes
1
answer
74
views
How can I check if `call`, `callv` failed
In Godot, how can I check whether e.g. Call(...) or Callv(...) succeeded or failed?
By failed I mean due to e.g. missing method, ...
1
vote
1
answer
36
views
Visual shader dropdown missing
I can't seem to create a visual shader in godot 4, in order to use the visual shader editor.
what am I missing?
1
vote
0
answers
62
views
Sprite2D texture repeat switches from Mirror to Disabled when resizing window
In Godot 4, I set the texture repeat of a Sprite2D to 'Mirror',
When I run the game, it works fine except when I resize the window — then the texture repeat switches to 'disabled'.
Is there a ...
1
vote
1
answer
291
views
JIttery rendering and ghost trail behind platformer character in Godot
I have no gamedev experience and I just started learning. I wanted to develop a basic platformer to learn.
I got stuck pretty soon with rendering in Godot. When I run the game, it just feels... ...
1
vote
1
answer
120
views
Stay Upright Within Rotating Area
I am making a game that takes place in space and I want you to be able to stay upright in a spaceship even if it rotates. I have this set up:
Its a platform and an area that rotates. I have ...
0
votes
1
answer
283
views
How to assign a Resource Array to a variable in Godot 4?
In Godot 3, you could do this:
export var (Array, Resource) test_variable
I tried to recreate this in Godot 4, but I could not figure out how. This is what I tried:...
0
votes
1
answer
45
views
What does the Project Manager star do?
Can't seem to find any reference to this,
...but what does the star on the left hand side Godot Engine Project Manager actually do?
Yes, I also need better names for my projects.
1
vote
1
answer
115
views
Draw a sprite x number of times in GDscript
Ok this has stumped me. In Godot 4.x, how do I programmatically (GDscript) draw a sprite x number of times (with an offset)?
I can manually add sprites in the editor over and over again. Only I don't ...
1
vote
1
answer
66
views
How to overshoot with direction_to
I've managed to get my sprite enemies shoot at the player with
...
3
votes
1
answer
163
views
How to Y-Sort a multi-tile entity as a single tile?
I am trying to use Y-Sorting on a tilemap tree to Y-Sort the whole tree, but it is Y-Sorting each tile of the tree instead of the tree as a whole:
I have tried adjusting the Y-Sort Origin but that ...
2
votes
1
answer
437
views
Why can't I access my custom signal under the SignalName subclass when trying to emit it?
I have recently decided to start learning Godot after previously having experience with Unity, and am continuing with C# as my primary scripting language. While everything else regarding signals seems ...
0
votes
0
answers
65
views
Two CollisionShape2D's Overlapping
I am trying to make a game in Godot 4.1.1 and I encountered a problem.
Whenever my player collides with the enemy, their collision shapes overlap and the enemy stays connected to the player.
Here's ...
0
votes
0
answers
60
views
Reset signal in Godot
Is there a way to reset a signal in Godot 4.x?
Yeah... odd question but hear me out.
signal hit
and at some point:
...
1
vote
1
answer
319
views
How to compare a vector to a rotation in Godot 4.1?
The Context
In Godot 4.1, I have a third-person character controller. It's a CharacterBody3D with a child Node3D called PlayerContent. The visual components of the character (model, etc.) are all ...
2
votes
2
answers
197
views
Un-pause game button not working
I can successfully pause my game with Godot 4.1 with:
...
0
votes
0
answers
84
views
Collapse/uncollapse a Tree in Godot 4 by clicking on the TreeItem?
Is there a way to collapse/uncollapse a Tree (Control) in Godot 4 by clicking on the TreeItem instead of the folding arrow?
I ...
2
votes
2
answers
96
views
Opening Godot documentation when the caret is on an engine-related keyword
In Godot 3.x, pressing the F1 shortcut while the blinking text cursor is on an engine-related keyword (methods, properties, etc.) will open the in-editor documentation window at the page related to ...