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

Handle short and long clicks, drag and drop and sprites overlapping?

My game is going to be using touch controls and I'm having a lot of trouble implementing the following mechanics. When I make a short click on a sprite, I want it to do a simple click event, in my code, it should highlight the sprite. But when I…
0
votes
2 answers

Class method returns null every time

I've made a class script that looks like this: extends Node class_name Class func method(): pass Then I've added a child node using that script in my main scene. Next, in my main scene gdscript, I've added this bunch of code: extends…
0
votes
1 answer

New to Coding Very confused

I'm new to coding in general and I'm trying to make a sprite change texture so it has a walking animation but I can't seem to figure out how to apply a wait() or something to my code. if Input.is_action_pressed("move_up"): vel.y -= 1 …
0
votes
2 answers

Why is Godot having problems with elif statements?

Here is the code with the elif statement, this one and elif statements in general. I'm fairly new to Godot and this is me following an example and learning along: extends AnimatedSprite func _process(delta): if…
0
votes
1 answer

How to call arguments in Godot engine?

I am trying to make gravity for my character, but I can't use is_on_floor() without calling move_and_slide(). How do I call move_and_slide() in GDscript?
GoomyBoy
  • 29
  • 3
0
votes
1 answer

Convert PoolByteArray to float

My code currently calculates the single-precision float manually based on the IEEE 754 specs. However, in languages like C, this entire operation is effectively a nop. Is there a better (faster) way to do this conversion? func…
programagor
  • 288
  • 4
  • 12
0
votes
2 answers

Is it possible to emit signals to a different tree?

I am currently making a simple tree which looks like this : MainNode (Parent) -> Character (Child) MainNode can add child or free one from any files such as maps (i.e. terrain.tscn) or events (i.e. event.tscn). All events and maps will be stored…
Shortcake
  • 1
  • 1
0
votes
2 answers

How do you make a MMO like skill hotbar in Godot?

I want to create a "hotbar" like in MMO or MOBA games where a key press activates a skill. I found a gdscript tutorial but it uses clicks and not key presses. I tried changing the code to check for when "K" is pressed with if…
0
votes
1 answer

(Godot) Saving multiple keys and reloading them

I'm kind of stumped. I've followed and adapted the save system from this. To phrase the problem, I'm unsure how to load the dictionaries back into the original variables. Most likely easier to explain the problem as you see it. # This would be…
0
votes
1 answer

What do I should use for saving a text like a pdf in gdscript

I want to make a multi-device software with godot engine and I want to make it as lite as I can, so I just want to use a Line edit node and a button for saving the text but, is there any way to save it as .txt and .pdf files with code or I need an…
user13901811
0
votes
1 answer

Does OS.shell_open("http://webpage") work on Android?

I am working on something like a one click hyperlinks ( I mean, like an icon that when clicked takes you to a webpage) for multi - device with godot and I fount this OS.shell_open("http://webpage") At the official godot q&a page, but I don't know…
user13901811
0
votes
1 answer

Changing color of the taskbar icon

I wanted to make a software with Godot in GDScript that advice you when pressing the bloq mayus button changing the color of the taskbar icon. But, I couldn't find any special code or something that makes it. I saw the video of Adderly Cespedes…
user13901811
0
votes
2 answers

How to get the position of a different object in gdscript?

I have a player, and I want to be able to detect when they are near a ball so they can press 'E' to kick it. I'm new to godot and I'm probably just dumb but I can't figure out how to get the position of another object. I have 3 separate scenes:…
Mythikal
  • 27
  • 6
0
votes
1 answer

Godot 3.2.2 Google Play game services - Couldn't find singleton

Please can someone assist in getting the https://github.com/cgisca/PGSGP module working for Godot 3.2.2.stable.official. I followed the instructions on the README.md. I've had to add: [android] modules="org/godotengine/godot/PlayGameServices" in my…
0
votes
1 answer

How can I post nested data to the firebase firestore with HTTP requests?

So I've been playing around with the firebase firestore feature for my REST API backend for a Godot project I'm working on. I'm using HTTP requests to post and get data from the database. So far I've only been using simple types of data, associating…
Castor Mann
  • 92
  • 1
  • 8