Skip to main content

Questions tagged [gdscript]

GDScript is a high-level, progressively typed programming language designed to work with the Godot Engine. It uses a syntax similar to Python (blocks are indent-based and many keywords are similar).

Filter by
Sorted by
Tagged with
6 votes
4 answers
729 views

i am making a 3d tactics game, visually similar to something like final fantasy tactics. it's tile based, with units able to move up and down the level onto buildings and up staircases and what have ...
graveyard's user avatar
3 votes
1 answer
2k views

Can I instantiate a custom class during runtime through a String without knowing the value of the string when writing the code? Example: ...
Gidan's user avatar
  • 33
1 vote
1 answer
443 views

I have a large level design & I'm trying to take a pixel perfect screen shot of a particular area and/or the entire map bound within a region like this: The region can be changed in size and ...
cak3_lover's user avatar
1 vote
1 answer
353 views

This is my code: ...
shadowxstrike's user avatar
2 votes
1 answer
1k views

I am making a addon for my friends, and I am trying to make a custom node. It works, but I have a problem, the children of the custom node is visible in the scene dock. The ...
TheJalfireKnight's user avatar
2 votes
1 answer
1k views

I am messing around with Godot, and I couldn't seem to find a way to set the texture of a Panel node in Godot. First I tried using the ...
TheJalfireKnight's user avatar
0 votes
0 answers
104 views

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 ...
J4L0's user avatar
  • 1
1 vote
2 answers
918 views

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 ...
TheJalfireKnight's user avatar
1 vote
1 answer
2k views

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: ...
TheJalfireKnight's user avatar
1 vote
1 answer
642 views

I am new to game development, I am practicing by creating a pong game. I currently have an Area2D set up with a signal listening for ...
zeroparity's user avatar
0 votes
1 answer
3k views

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 ...
ThetaJones's user avatar
0 votes
1 answer
246 views

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 ...
ThetaJones's user avatar
0 votes
1 answer
179 views

I am working on a game. The camera is freely rotatable by the user. The background is displayed from an equirectangular image. I need to know which pixel of the background image is located under the ...
Matthew Carson's user avatar
0 votes
1 answer
666 views

I need to know how I can change scenes in Godot 3.5 when the player touches another CollisionShape2D. I've tried this: ...
shadowxstrike's user avatar
0 votes
1 answer
924 views

In a number of other engines I've worked with, including Unreal and Unity, there's been support for not only preprocessor commands, but conditional compilation based on platform. As an example, in ...
Michael Macha's user avatar
0 votes
1 answer
804 views

I'm using Godot for my current project, and it's been going great; but there's a bug I don't understand. I have a certain very simple script on my title screen: ...
Michael Macha's user avatar
3 votes
1 answer
361 views

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 ...
Jason O'Neil's user avatar
0 votes
0 answers
274 views

How would I convert even a section of the following code, which was taken from this GitHub Source to Godot C# or GDScript? I'm trying to make a Godot version of this project, but I don't know how to ...
Ethan's user avatar
  • 145
3 votes
1 answer
1k views

I can write a function like this: func foo(someCallableThatShouldReturnBool: Callable): if someCallableThatShouldReturnBool.call(): # do something ...
Kutub Gandhi's user avatar
1 vote
1 answer
273 views

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 ...
Askani's user avatar
  • 111
1 vote
0 answers
1k views

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: ...
TheJalfireKnight's user avatar
3 votes
1 answer
262 views

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, ...
geekley's user avatar
  • 133
1 vote
0 answers
191 views

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 ...
Shahzaib Hassan's user avatar
1 vote
1 answer
862 views

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 ...
TheJalfireKnight's user avatar
0 votes
1 answer
2k views

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:...
TheJalfireKnight's user avatar
3 votes
2 answers
1k views

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 ...
TheJalfireKnight's user avatar
0 votes
0 answers
313 views

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 ...
TheJalfireKnight's user avatar
1 vote
1 answer
2k views

I'm relatively new to Godot 4.0.3. I have two problems which seem to depend on each other so I put both of them into one single question. I know, these issues have been reported multiple times on ...
EarthAndMoon's user avatar
0 votes
1 answer
81 views

For my quick test to see if I can create multiple combatants for my battles, I would like to be able to continuous create party members/enemies in order to get to the correct amount of combatants ...
BoydyBoydy's user avatar
3 votes
2 answers
8k views

I would like to create and import a class in GDScript. Here is some non-functional pseudo code to explain what I'm trying to do: ...
Seph Reed's user avatar
  • 275
0 votes
1 answer
116 views

I am at the start of testing my game. I have just loaded in GUT and I am attempting to load some resources so that I can see the players stats and validate that they are initialised. Basic assert to ...
BoydyBoydy's user avatar
0 votes
1 answer
135 views

very simple logic but my brain is fried for now, so I don't get how to ad the option for an enemy to sometimes just go idle without breaking the entire animation logic... i tried adding a randomized ...
Cei's user avatar
  • 873
1 vote
1 answer
333 views

I'm using this video as guide for my Godot 3.5 project, but for some reason the code does fan the card but also the cards keep moving and spreading forever. The code: ...
Progs's user avatar
  • 95
1 vote
1 answer
686 views

I've been working on a 2D pixel-styled survival game(with the Godot Game Engine), from the birds-eye view(not a side scroller like Terraria) - where the world would look like a map if zoomed out. So ...
Apex's user avatar
  • 11
0 votes
1 answer
390 views

This is my actual set up, and for the moment I'm using this tutorial : https://www.youtube.com/watch?v=Mek4XtMhcMs&t=4s which is one of a kind, never found any other guide on how to make 3D melee ...
Cei's user avatar
  • 873
4 votes
2 answers
3k views

I'm an old coder, but a newbie to Godot. I'm using version 4. I got some unexpected (to me) behavior when I tried this code: ...
Adam Smith's user avatar
0 votes
2 answers
2k views

Is there a way in Godot's GDScript to quickly/easily break out of nested loops? For example: ...
user avatar
2 votes
3 answers
897 views

In games like Europa Universalis or Hearts of Iron, there is a way to set game speed. This affects how long does e.g. one in-game day take in real-life time. At first, I thought this mechanism was ...
jakub's user avatar
  • 145
0 votes
1 answer
639 views

When I try to create a "ColorRect" in code, it doesn't display. It still seems to exist, but I can't see it. I am expecting to see both the rect created in the editor at ...
Programmer S's user avatar
1 vote
1 answer
333 views

I wrote this script to design countdown in my game: ...
Nina Monti's user avatar
1 vote
1 answer
1k views

I followed an old tutorial about a card game and, after finishing it, I started removing some code I didn't like or it was simply not compatible with Godot 4. Anything went fine, except for one thing. ...
Life after Guest's user avatar
1 vote
1 answer
2k views

I have this specific Resource script: ...
Jeroen's user avatar
  • 695
3 votes
1 answer
1k views

In Godot GDScript, I have a function that returns a float. Inside the body of the function, I use the built-in method find, that ...
Life after Guest's user avatar
1 vote
1 answer
969 views

I'm trying to debug an issue with my game, where the function that should be connected to a signal is not being called. I have a created minimal repro of the situation by: Create a fresh Godot 4 ...
Jeroen's user avatar
  • 695
3 votes
2 answers
2k views

I'm trying to write a GDScript (using Godot 4) function that creates a new component at a specific Vector2 position. This works quite well with the following code: <...
Jeroen's user avatar
  • 695
3 votes
1 answer
358 views

I'm going through the "Creating your own resources" steps. Here's an abbreviated version of the demo resource bot_stats.tres and the associated ...
Jeroen's user avatar
  • 695
0 votes
1 answer
415 views

How to pass custom header information on a Godot4 WebSocketPeer connection?
Victor Lee's user avatar
1 vote
1 answer
423 views

I'm getting used to Godot 4.0, and I ran into an issue where the dropdown menu from OptionButton draws behind all the other control nodes (or, at the very least, those further down the scene tree). I ...
Freswinn's user avatar