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
0 answers

How can I change the charachter skin in godot?

I want to change the charachter skin in a different scene, but I don't know how to do this I want to make the player able to do this in a different scene and save it between scenes and make it able to select even if you quit the game and opened it…
0
votes
1 answer

Error parsing JSON at line 0: Expected '}'

I have to be missing something simple here. It loads the file just fine but will not parse it at all. const vFile = "res://Data/Companions.json" func _Parse(): var vData = {} var file = File.new() assert(file.file_exists(vFile)) …
JSands
  • 133
  • 7
0
votes
0 answers

(Godot Engine) Compute string as PEMDAS

I've been trying to create a function in GDScript to process and calculate a string using PEMDAS rules. Below is my try on the subject. It can so far only use the MDAS rules: Is there a better way to achieve such a function? func _ready() -> void: …
KanaszM
  • 151
  • 9
0
votes
0 answers

How to create top down Player movement with one button in Godot

Is there better way to create top down player movement using one button. In position1 player don't move. as the button drag toward any direction player should move to the same direction and rotate to the same angle. What is the best way to do this.…
0
votes
1 answer

GODOT - Select an array based on a dynamic variable

I have 5 arrays created in a function. When I call that function I pass in a "type" with the call (it's the only parameter the function accepts). I want to grab one of the arrays based on that type which is passed in. So, for example, say I call…
0
votes
1 answer

KinematicBody.move_and_slide() can only be called from an instance

I am new to Godot game engine. Though, I have developed many 2D games with Python and pygame, this is my first time working with 3D. I have just tried to move a kinematic body from its place using GDscript and I am getting an error while calling…
0
votes
1 answer

Why this error message appear?: invalid get index 'game_started' (on base: 'Node')

can you please help me, I have this script: extends KinematicBody2D var motion = Vector2(0, 300) var sensitivity = 13 onready var player = get_node("../Player") onready var enemy = get_node("../Enemy") func _ready(): randomize() …
0
votes
0 answers

All function calls are null?

For some reason every time I go to call a function it is null, no matter the circumstances. It could be .set(), .set_text(), or even .connect() I can't tell if this is the engine issue or what (I'm using the latest build...), but I can't seem to…
0
votes
1 answer

How can I call a function of a class in another script on GDScript?

how are you, night. Okey I have this. File (Grid.gd) class Grid: var gridArray : Array func SystemGrid(width : int, height : int): self.width = width self.height = height print(width+" , "+height) I want to call…
0
votes
1 answer

Aerial Attack on Godot

I'm new to Godot, and I'm making a personal project, a 2D platformer, a clone of Ninja Gaiden (1988), but I'm having trouble getting the aerial attack to work. The Player script is the following: extends KinematicBody2D onready var Animated_player…
0
votes
0 answers

Stutter with a moving platform using Tween movement

I'm having stuttering issues with a specific type of platform in my game, a vertical moving platform. Right now I'm moving it with a tween with the interpolate_property function, where the platform will tween itself from the position its currently…
Onii
  • 1
0
votes
1 answer

Godot - Missing Nodes

This is difficult to explain with typing... I have a GameController scene (Node2D) that holds 3 instanced scenes within: Mouse (scenes/Mouse.tscn) - this just swaps the mouse cursor for a custom graphic HeaderBar (scenes/HeaderBar.tscn) - this is…
0
votes
0 answers

How to implement the logic for a word search game in Godot

I am new to the GODOT engine and I am trying to create a word search game. I am not sure where to start with the game and UI logic and unfortunately, there are no examples or tutorials to help me get started. Any advice or resources I could use?
el_M
  • 149
  • 15
0
votes
1 answer

How to make a MOBA game control?

I want to do the controls like in Dota. There, when you click on any terrain, a point appears where the character needs to go. How to make this system? I am trying to do this with rays but cannot find the end position: var space_state =…
user15974620
0
votes
0 answers

How can i delay 1 second and then continue code in Android Studio?

In Gdscript for Godot there was code line that waits for 1 second and then continues the code. yield(get_tree().create_timer(1),"timeout") How can i achieve same usage in Kotlin in Android Studio?
Serdar Çivi
  • 181
  • 1
  • 8