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

Teleporting node

I am trying to teleport my player node(kinematicbody2d) when it hits my finish node (area2d) from the side of the Finish node BTW I'm using godot 3 What I tried:Change the location using get_node("player").set_pos and…
0
votes
1 answer

Global variable data not passed [Godot.2.15]

I was creating a "Addition mental math calculator" in Godot ,where the user is shown a new question on hitting "on_Button_pressed" button and the sum is stored in "global var c "and then the input is accessed via "Lineedit" and stored in "var d"…
srt111
  • 1,079
  • 11
  • 20
0
votes
1 answer

how can I use get_children() after I used queue_free() or free() on a node?

I have a main node A and a sub node of A called "B", the problem is when I queue_free() to node b and tries to see how many nodes in A it gives me the same number. I'm testing how many nodes inside A by using get_children() inside…
0
votes
1 answer

godot invalid get index '-1'(on base 'array') during A.P.I

I'm making an A.P.I. that displays dialogue, choices, sprites, audio etc. etc., i was able to do it after looking up this video on youtube but i keep getting this error invalid get '-1' (on base 'array') here's my code so you can see extends…
Lynn Len
  • 91
  • 1
  • 2
  • 8
0
votes
1 answer

Godot 3.1 - Load resources dynamically

I'm trying to load resources dynamically. It works normally on the computer, but on android the following error occurs: Invalid type in built-in function 'dict2inst'. Cannot convert argument 1 from Nil to Dictionary. I'm trying to load some Curve2D…
0
votes
0 answers

Drag and drop not working in grid container in Godot 3

I'm working on the UI for a tower defense game for my university's video game development club using Godot. I have code to drag towers from the menu onto the board, but it's not working properly. I've tested it in a separate file and it works fine,…
0
votes
0 answers

Monster Auto shooting when player enter the monsters field of vision

I'm new to gdscript trying make 2D platformer game in godot3,I'm able to instance a fire scene when the Player node enters the area2D which is im using as field of vision but the scene only instantiate once.How do we keep instancing the fire scene…
0
votes
1 answer

GDscript: Shoot bullet after Animation Complete

I am creating a simple 2d Platform Game, My problem is that in one of my animations, the bullet/Bone needs to be created after the animation is complete. Right now it creates the Bone and starts the animation at the same time. I have tried putting…
0
votes
1 answer

Slide Animation when switching to another scene in Godot Game Engine

I'm making a GUI using godot and I want transition animation when switching to another scene instead of instant change (No animation) when using get_tree().change_scene("MyOtherScene") I am trying to mimic the ios feel when switching to another…
009820
  • 37
  • 2
  • 9
0
votes
1 answer

Is there a way to define a to_json handler in GDScript?

I'm new to GDScript and am looking at how best to save data to a text file. to_json works well for basic types but I just get a reference id for any custom classes. I'd ideally like to pass a dictionary of data including some custom class elements…
Simon
  • 61
  • 2
  • 8
0
votes
1 answer

Adding items from a player to the tilemap godot

I am trying to drop items from a players inventory onto the floor. Currently, I am storing items as kinematicBody2Ds, this will likely change, but I would like to create a node on the map via GDScript. Is it possible to create items from already…
Fortune
  • 173
  • 1
  • 3
  • 8
0
votes
2 answers

GdScript get node path on collision

Say you have multiple areas, and when one overlaps, you want the script to get the node path of the overlapped node. In short, how do you get overlapped nodes’ node paths. Thanks
0
votes
1 answer

Godot 3.0 Change collision box at runtime

In my (first) project in Godot, a simple platformer, I wanted to have the character slide. When the character slides, he should only be one tile tall so he can fit through smaller gaps. Because I didn't know any better solution, I changed the…
lbuchli
  • 21
  • 4
0
votes
1 answer

Godot engine: removing an instance of a scene without freeing the whole scene

I’ve added multiple instances of a scene as enemies, and now I want to remove one of them when it dies. I tried using “queue_free()” on it, but this only works for one instance, and every instance afterwards doesn’t get removed and returns a “node…
werner_b
  • 47
  • 2
  • 11
0
votes
1 answer

Godot: Change node position in keyframe

I'm doing a game in Godot, and I created a simple move animation with AnimationPlayer that moves the node from position A to position B. The animation is two keyframes. Now I want to change position B with code, how can I do it? I was thinking…
JCAguilera
  • 944
  • 1
  • 13
  • 32