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

Godot: Pause Menu does not load up the Main Menu properly

I've coded a Main Menu here with the following nodes: (Screenshot) Two texture buttons Two Sprites And a tilemap The issue here is that my main scene is the main menu scene which contains everything I've shown above. However, when I call this…
0
votes
0 answers

Godot: Unable to use get_node() to get the node

Using some python in the past, I decided to learn some godot and do some basic stuff like creating a main menu of a game. But, I'm trying to create a main menu in which if the Controller is detected, the bottom two images will show "DPAD to select"…
0
votes
1 answer

set_global_position setting position to the wrong value

Hey there I have a function which positions a KinematicBody2D's (the Player) body next to a Node2D (a portal). 2 portals are linked together and when the player enters portal X in Scene A they are placed next to the corresponding portal X in Scene B…
0
votes
1 answer

Does C# have access to the same stuff as GDscript?

I barely scratched the surface of using godot, but I prefer the syntax of C# a lot more than gdscript (I hate _s in my code). I was wondering, does C# have access to all the same methods that gdscript comes with? Or would I have to import libraries…
0
votes
0 answers

GDScript modularization

Is it possible to modularize in GDScript? What I have in mind is that I have a player class with variable input, of type IInput, like this: Player.gd: extends KinematicBody var input = load("res://Scripts/Inputs/PlayerInput.gd").new() func…
Monset
  • 648
  • 5
  • 25
0
votes
1 answer

Spawned bullets in Godot are oriented wrongly

I'm trying to make the player shoot bullets out The thing is, they're not pointing in the same direction as the player They also do not follow the player as they move around code for the bullet I store the object that shot the bullet so that the…
Manglemix
  • 3
  • 1
0
votes
2 answers

How do i set the x and y coordinates of a instance in GDscript

I do not know how to set the position of a instance in gd script. The instanced shows up on the corner of the screen. Thanks :)
Vlad Ivanov
  • 59
  • 2
  • 3
0
votes
1 answer

GODOT - ResourLoader not loading the next scene

I'm making a prototype game that involves a menu and a main scene. And while the main scene isn't big enough that the get_tree().change_scene("res://Main.tscn") thread block is a problem, I wanted to develop a loading so that I can show this…
user12872532
0
votes
1 answer

Godot Invalid get index 'Player' on base 'KinematicBody2D'

Ok guys, i just trying to make a function to make a camera like top-down games with rooms, and idk why this appear, can you help me? Code and error (Screenshot)
Endy
  • 1
0
votes
1 answer

Error on function call for Area2D randomly occurs

I have created a system, within which I am instancing kinematic bodies (2D). These have scripts attached. When I call the functions within these, all is GENERALLY okay. However randomly, with wildly different wait times for it to happen (sometimes…
notme21
  • 47
  • 9
0
votes
2 answers

Godot - I'm having trouble getting rid of stored momentum when toggling to different movement modes

I'm new to both Stackoverflow and Godot. I have a script for my player which allows me to switch from momentum-based movement (winged) to traditional 8-direction movement (running). However, when I disable (winged) whilst I'm moving, and toggle…
0
votes
0 answers

Godot: MultiMesh deletes itself when created by script

I'm making a game in Godot and decided to use MultiMesh to load groups of objects. However, every time a create a new instance of the object, it deletes itself and just shows as 'empty' on the inspector. I've also tried loading a resource from a…
N4L8
  • 11
0
votes
1 answer

What does it mean when a KinematicBody2D is stored in a JSON file - Godot?

After writing a few files for saving in my JSON file in Godot. I saved the information in a variable called LData and it is working. LData looks like this: { "ingredients":[ "[KinematicBody2D:1370]" ], "collected":[ { …
Mana
  • 352
  • 5
  • 22
0
votes
1 answer

Godot Signal "Emitted" but not "Received"

I've been trying to send a signal from a singleton script in this manner: if(Input.is_action_just_pressed("ui_select")): emit_signal("update_inventory") #More Code underneath - I have declared the signal on a UI Element that displays my…
Mana
  • 352
  • 5
  • 22
0
votes
1 answer

Why isn't my code working for basic Movement in Godot?

I just started a new project in godot. So far I have one png which is the main player. I have added a sprite and CollisionShape2D to the player. When i run the game the player does not move (using keys). Does anyone know what is going on here? Heres…
jzuraf
  • 53
  • 1
  • 11