Skip to content

u/IntangibleMatter

In this archive from Jan 2019 to Aug 2025

64
posts
75
comments
18
media
2.8k
score
2 saved before deletion

Wow it’s almost like the solution…. Would be mandating that people read the FAQ…. And having posts that ask questions in the FAQ taken down automatically.

Obviously people are still not going to know things and ask questions that a hundred thousand other people have asked, but if we can catch 9 out of 10 of those before they post, we’re going to massively cut down on the “can Godot do X” spam this sub gets

1 points

I mean I think that section of the FAQ should go into detail about different types of games, otherwise it would be redundant. And yeah, there would be something in there for if it absolutely DOES NOT answer your question. Maybe at the bottom it says like “if you did not see the type of game mentioned here, please make a post and include the word ‘transient’ in the title” just to make sure people had read it

1 points

Fair enough lmao. Let me give you a tip for the formatting!

Reddit uses Markdown (or it does when you aren’t using the Fancy-pants editor) for posts, so when writing a greentext you have two options:

  1. Enclose it in a set of 3 tildes (```), which turns it into a codeblock
  2. Put backslashes before the angular brackets at the start of lines (\> like so), as otherwise it’ll become a quote block. Additionally put backslashes at the ends of lines (like this\) to make it so that the newline is escaped, and treated as a line break rather than a space, which is what a single newline is by default in markdown
3 points

While that is possible (and something that I’ve done before for more complex things), creating a class and then adding an instance of said class every time you want to call a function is a bit…. Annoying. Say you had a function with four arguments, here are three ways that could look.

func do_something(data: DoSmthClass) -> void:
     # we don’t need to do any safety checks, but we did allocate memory for a whole class. Not all that bad in Godot but not ideal when just calling a function. 

func call_do_something() -> void:
    var obj := DoSmthClass.new()
    obj.param1 = 7
    obj.param3 = false

class DoSmthClass:
    extends RefCounted
    var param1 :int = 0
    var param2: String = “”
    var param3: bool = true
    var param4: Vector2 = Vector2.ZERO

As we can see, for this method, every time we want to call the function we need to

  1. Create an object
  2. Set parameters on the object
  3. Call the function

Alright, not the worst, but there are nicer ways to do it.

func do_something(data: Dictionary) -> void:
     # we need to check that every parameter is valid and of the correct data type. 
    var param1 :int = 0
    var param2: String = “”
    var param3: bool = true
    var param4: Vector2 = Vector2.ZERO
    if data.has(“param1”):
        if typeof(data.param1) == TYPE_INT:
            param1 = data.param1
    if data.has(“param2”):
        if typeof(data.param2) == TYPE_STRING:
            param2 = data.param2
    # and so on…


func call_do_something() -> void:
    do_something({“param1”: 7, “param3”: false})

Okay, now let’s see the way that I would do it.

func do_something(param1 := 0, param2 := “”, param3 := true, param4 := Vector2.ZERO) -> void:
     # we don’t need to do any safety checks. We know all the data will be here. 

func call_do_something() -> void:
    do_something(7, “”, false)

It can get unwieldy in larger functions, but if you have like ten different arguments you may want to call for a function…. You should probably split that function up.

4 points

Personally how I would do this is something like the following:

  1. Raycast to find edge of wall
  2. Use Area2D to check if there’s a wall at the position every x units along the line, until either it gets a free space, or it’s gone the farthest distance you want it to go.
  3. If it’s a free space, tween the player’s position between those two locations with whatever effects you want (make sure to turn off collisions during the dash)
  4. You’ve dashed
1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.