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).

GDScript is a high-level, progressively typed programming language. It uses a syntax similar to (blocks are indent-based and many keywords are similar). Its goal is to be optimized for and tightly integrated with Godot Engine, allowing great flexibility for content creation and integration.

839 questions
0
votes
1 answer

Using a custom font on a button in gdscript

I am currently working on a game menu with 3 options: New game, Load Game, and Options. I have also attached a piece of code to New Game to make it print something for now. I have also added a custom font, and I made some code which is supposed to…
RockZombie
  • 101
  • 1
  • 9
0
votes
1 answer

How could I create a music file using godot?

I'm trying to create a music game using godot, it's similar to playing a piano, the player presses keys, each key has a sound assigned, and the music plays. What I want is to have a kind of recorder inside the game to be able to save the melody…
Isabel
  • 56
  • 6
0
votes
1 answer

KinematicBody won't move along z-axis (Godot)

I'm beginning a new project and just started coding the movement script. I'm using the same old method I use every time but for some reason I cant move forward and backwards(z-axis). This is odd because left and right (x-axis) uses functionally…
0
votes
1 answer

Rotate self between an arc on the local axis Godot

I have a node which fires a bullet, but I want to randomly rotate it a little so that certain guns are unpredictable. Specifically, I want to rotate it on the X and Y axes between a -2.5 - 2.5 degree arc on the local axis. I've tried rotation.x =…
benman
  • 137
  • 1
  • 11
0
votes
0 answers

How do I add Biomes to a Procedurally Generated Terrain with Open Simplex Noise in Godot

I have an Open Simplex Terrain generation in Godot system based on the one showed in this video, and I was wondering the most simple way I could implement biomes like mesas, mountains, plains, etc. How would I alter the height different segments of…
0
votes
2 answers

Why doesn't this gdscript dialog box code work?

Why doesn't this code work? I don't know how to describe what happens but here's the code. extends Node2D onready var dialog_box = get_node("DialogBox") func _ready(): ShowDialog("Example") func ShowDialog(text, font = "DTM-Mono.ttf", time…
0
votes
1 answer

How do I emit a signal argument as an int instead of string?

In Godot 3.3, I'm trying to make a Label respond to text entered through a LineEdit node. I connected the objects and can emit the signal, but the signal is only ever sent as a string, not as the int that I want. When I use the strong typing, I get…
VHS
  • 103
  • 5
0
votes
1 answer

Godot - Populate a screen with different sized panels

Hey I'm looking for some help. I am trying to populate a screen with panels/2D Nodes of different set sizes. I'll be using 2 arrays to be able to do this but the issue I am coming across is that I'm not sure how to do this without causing gaps…
user3618687
  • 113
  • 1
  • 11
0
votes
1 answer

Godot 3.3.2: Can't change this state while flushing queries. Use call_deferred() or set_deferred() to change monitoring state instead(error)

My game that I'm working on, my character can kill enemies but when the enemies die, they do not lose there collision box, and when I run the game and kill the enemies it comes up with the error in the title. The entire enemy code is pasted…
Snaza
  • 1
0
votes
1 answer

Merge Two of the same TileMap

I'm making a system that spawns a scene with a premade room, even though the TileMap nodes contain the exact same set, they don't interact with other giving this weird sectioned feeling to them. I attempted to make a code to get them fuse into one…
Sacul
  • 11
  • 3
0
votes
1 answer

How to edit a previous line of a Label with a script in Godot

I need to add something to a label that's up on a line above an existing line with a script, how would I do that?
MrZantoid
  • 13
  • 1
0
votes
2 answers

Gogot Engine error issue: "body set shape disabled" and "body set shape as one-way collision"

I have a problem with the engine Godot, with the errors "body set shape disabled" and "body set shape as one-way collision". In my project I have built four scenes: The platform scene formed by (StaticBody2D which has as child…
Peppe32
  • 23
  • 3
0
votes
1 answer

Find the node which a shape belongs to using cordinates

I'm currently in doubt if I can use coordinates(X,Y) to find if there is an shape in said coordinate, and if there is I would get/find the node which the coordinate is in belongs to?
WannabeDev
  • 41
  • 5
0
votes
1 answer

Godot GDScript "too many arguments" error

I got this error in one of my gdscript scripts in a Godot project: "Too many arguments for "get_script()" call. Expected at most 0." For this line of code: onready var coinscript = get_script("res://path/script.gd") I have no idea why this error…
Tibbe
  • 1
  • 1
0
votes
1 answer

How to make a function run at custom fps in Godot using Gdscript

I want to make a timer function in Godot that would use the computers frame rate in order to run code at whatever fps I choose (ex. 60 fps). So far I have code for a basic timer: var t =…
Joe
  • 345
  • 1
  • 14