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

What does func _physics_process(delta), move_and_slide(), Vector2() and do in gdscript?

I'm just started learning to program because I want to learn how to make a game. I choose the Godot engine to start making games but I can't understand what anything does. I have only understood the concept of variables and constants. I'm watching a…
Koro422
  • 1
  • 1
0
votes
1 answer

how to execute a function inside the process function of godot every 1min?

I need to implement to deduction coin for every 1 minute from user. I would do this Player.gd var game_started = false var time_start = 0 var time_now = 0 func _process(delta): if game_started == true: …
tree em
  • 20,379
  • 30
  • 92
  • 130
0
votes
2 answers

Gdscript Bug or strange behaviour

I've noticed some strange behaviour in gdscript. when you declare variables var value = [0, 0, 0, 0, 0] var values = [] and append one to the other values.append(value) and then change something in the array value[1] = 1 If you would then print…
Sephen
  • 1,111
  • 3
  • 16
  • 38
0
votes
1 answer

Godot: directory recursive function stackoverflow

The following function prints the directories and files within a path, I want it to go into the directories and sub directories by using a recursive function. This causes a stackoverflow error. It only works if doesn't call "RecursiveSearch" func…
Alonso
  • 25
  • 3
0
votes
0 answers

Popping value from array within function

If I create a function in python that takes in an array and pops a value, will the array be permanently changed outside of the function? ie func popRandom(array): array.shuffle() return array.pop() Will the array be permanently altered…
GT.
  • 764
  • 1
  • 8
  • 30
0
votes
1 answer

Godot how to get collision layer of colliding objects programmatically?

I have 3 collision layers: Player Coin Enemy My nodes are colliding well, but when my Player collides with the Coin or the Enemy i can't differentiate between the two of them. Normally i would do this by setting collision groups but if the layers…
jogarcia
  • 2,327
  • 2
  • 19
  • 34
0
votes
0 answers

Godot Project Has 100 Errors When Exported To Xcode [Arm64]

I have been learning how to use Godot and recently I tried to export my project to Xcode to see how my game would look on my phone. When I try to run it, it shows that there are exactly 100 errors. The error code is huge! Ld…
0
votes
1 answer

Convert data of a dictonary back to its proper data type after importing from a json file

My question is similar to this I am using godot game engine and it uses gdscript. I request the moderators to let it stay at least till I get a proper reply. I am at the end of my project this is the only thing I can't accomplish. So, hoping someone…
0
votes
1 answer

cant add camera rotation in gdscript

I'm trying to add camera rotation to my character in Godot, but I keep getting the error "Invalid call to function 'rotated' in base 'Vector3'.Expected 2 arguments" i tried making the direction variable a vector 2, but when i did that the physics…
Max
  • 1
0
votes
1 answer

How to compare two node coordinates in godot

this might be an easy thing to solve but i'm pretty new to godot and gdscript so i have no idea of how to do it and i can't find a tutorial or anything that works for my 2D platformer. I have a Sprite with a CollisionShape2d that changes the scene…
0
votes
1 answer

Overriding a critical base method while preserving its functionality without making my code smelly

In Godot, it is possible to define a signal and emit it in a method, which will call all the methods connected to it. In this example, on_met_customer() is connected to signal met_customer in the class Merchant, which is responsible for detecting…
Belaidev
  • 37
  • 7
0
votes
1 answer

Migrating a TaskManager script from gdscript/Godot to bevy and rust

I'm building a city building game prototype where i have villagers doing many different tasks at the same time, such as carrying stuff, building, harvesting, for that purpose i created a TaskManager singleton script with a task backlog array and an…
Onizudo
  • 313
  • 3
  • 7
  • 21
0
votes
1 answer

Mouse Wheel Zoom functionality based on camera rotation and forward vector

I am quite happy with the progress that I have made thus far on my 3D Camera, but I feel it is missing scroll wheel zoom-in zoom-out functionality. I have been attempting to program a cam_zoom() function for some time now and I am confused with how…
Intro verb
  • 13
  • 3
0
votes
1 answer

Create Simple Struct from JSON parse

This is confusing for me and I have been unable to find an answer so far. I have a list of Factions for my game. This list is stored in a .cdb (CastleDB) file .cdb is essentially a way of storing .JSON, with the added benefit of having a rows and…
Intro verb
  • 13
  • 3
0
votes
2 answers

Godot rigidbody is not moving when force is added

I just switched from Unity to Godot, and have been having trouble with physics-based player movement. I wrote a script in GDscript that is supposed to add a force to the rigidbody. It didn't work, so I had it log a variable to the console whenever I…