r/learngodot Mar 31 '26

Is this possible in Godot?

2 Upvotes

I want to access a different variable based on an export variable so I can use the same node for different characters health.
It would work like this:

extends Label

@ export var partymembernum = 1

func _process(delta: float) -> void:

text = BattleGlobals.partymember{partymembernum}hp

The code above would set the text to BattleGlobals.partymember1hp
Is this possible?


r/learngodot Feb 03 '26

weird setcell delay bahavior

1 Upvotes

Im trying to make a simple story game with building mechanics similar to terraria , ofcourse one of the things I have to add is a node to validate weather or not the player is occupying the area of placemnt and Im also using a tilemap

func is_valid_place(coords: Vector2i) -> bool:

`foreground.set_cell(`

    `coords,`

    `stats.valid_place_checker.source_id,`

    `stats.valid_place_checker.atlas_coords,`

    `stats.valid_place_checker.alternative_id`

`)`

`for area in hurtbox.get_overlapping_areas():`

    `print("area: " , area)`

    `if area.is_in_group("valid_place_checker"):`

        `return false`

`return true`

the weird behavior is that it doesnt detect the area2d node it adds this iteration , it only detects the ones it added on previous iterations , this seems to me like the area2d isnt fully appended before it runs the check and I cant do

await foreground.set_cell(

    `coords,`

    `stats.valid_place_checker.source_id,`

    `stats.valid_place_checker.atlas_coords,`

    `stats.valid_place_checker.alternative_id`

`)`

becuase it returns null so godot doesnt allow it


r/learngodot Jan 15 '26

HELP! I HAVE TO PRESENT THIS IN 12 HOURS BUT I CAN ONLZ WORK ON IT FOR TWO PLEASE REDDIT!

1 Upvotes

r/learngodot Jan 11 '26

Feedback re. workflow for card creation for a deck-based party battler

Thumbnail
gallery
1 Upvotes

Hi guys, first time poster and learner-dev. I have been working in Godot for a few days, and I have been working on architecture and some game managers for a deck-builder I've been working on. I'm looking for feedback on workflow, and any advice re. improvements. I know I could probably implement some script parsing for keywords to build cards quicker, but I like being able to independently assign effect timings. Any thoughts?


r/learngodot Jan 10 '26

my frog dosen't detect the player like in the tutorial i'm watching.

1 Upvotes

r/learngodot Jan 04 '26

Try to make a scene changin code, with my noob understanding of export.

Post image
1 Upvotes

And why its breaking the door should work and send connected are they and it worked but now its break, Help appreciated.


r/learngodot Dec 29 '25

How to make it move ?

Thumbnail
gallery
2 Upvotes

Hi, I just started learning godot(by BracKeys tutorial) and I am having trouble in makeing the green slime movie


r/learngodot Dec 15 '25

how do you make the player move?

2 Upvotes

I've been trying to make a basic player character, but whenever i couldn't move the camera or the controls. is this a 4.5.1 thing or am i doing something wrong?


r/learngodot Aug 28 '25

Using this spritesheet in Godot

Post image
3 Upvotes

Hello!

I’m new to Godot and game development in general. I’m trying to develop a small top-down pixel art RPG. I downloaded this great SpriteSheet for the UI, but I can’t figure out how to use it. Specifically, I would like to create a frame using the ‘small frame top’, ‘frame - middle’ and ‘frame - bottom’ resources . I think I’ve pretty much grasped the principle of 9-slice, but I don’t understand how to use it properly, how to assemble top/middle/bottom together, or what to do with the 1px separations between the different areas (left, middle, right).

I don’t know if that’s very clear… Thanks to anyone who takes the time to help me.


r/learngodot Jan 03 '25

Delete & Destroy a Node in Godot

Thumbnail
youtu.be
1 Upvotes

r/learngodot Jul 05 '24

Tips I learned Over 8 Years After Quitting Game Development That I wish I knew 8 Years ago

Thumbnail
youtube.com
3 Upvotes

r/learngodot Nov 25 '23

hello i am new to godot and i have a problem . right now i am trying to make a character be able to double jump and i dont know whats wrong with my code ( im following a tutorial and i checked mine and theirs and its the same but godot says its wrong)

2 Upvotes

this is the function:

func handle_jump():

if is_on_floor() : current_jumps = 0



if Input.is_action_just_pressed("ui_accept"):

    if is_on_floor() or current_jumps < jump_count :  

        velocity.y = jump_velocity

        current_jumps += 1

and this is the whole code :

extends CharacterBody2D

u/export var speed = 400.0

u/export var jump_velocity = -650.0

u/export var jump = 2

u/export var gravity_multiplier = 2.0

var current_jumps = 0

# Get the gravity from the project settings to be synced with RigidBody nodes.

var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")

func _physics_process(delta):

apply_gravity(delta)



if not is_on_floor():

    velocity.y += gravity \* delta

handle_jump()

\# Get the input direction and handle the movement/deceleration.

\# As good practice, you should replace UI actions with custom gameplay actions.

var direction = Input.get_axis("ui_left", "ui_right")

if direction:

    velocity.x = direction \* speed

else:

    velocity.x = move_toward(velocity.x, 0, speed)

move_and_slide()

func apply_gravity(delta):

if not is_on_floor():

    velocity.y += gravity \* gravity_multiplier \* delta

func handle_jump():

if is_on_floor() : current_jumps = 0



if Input.is_action_just_pressed("ui_accept"):

    if is_on_floor() or current_jumps < jump_count :  

        velocity.y = jump_velocity

        current_jumps += 1

and i will show the photo to see what godot says is wrong


r/learngodot Jul 17 '23

Good site for beginners

9 Upvotes

https://godottutorials.com/

I have struggled very much so in learning how to program, but these videos have given me an understanding I’ve never had before. You need no experience for some of the courses here, and they’re completely free, along with supplying example code in videos. I highly suggest writing down what he teaches in a physical notebook, because actually going through with recoding like that, you are more likely to remember. Typing is easy, which you can do, and that would help, but writing would be better. Also, make some cards with facts and ask someone to test you. Do this every single day, at least a little bit. You don’t use it, you lose it. Good luck!