Skip to content

Commit 837be5d

Browse files
committed
Clarify types
1 parent 4baba4f commit 837be5d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/blog/2025-10-23-godot-types.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Many types in Godot such as [AStar3D](https://docs.godotengine.org/en/stable/cla
1414
extends Node
1515
1616
func fun_with_refs() -> void:
17-
var my_ref = AStar3D.new() # creates a refcount
17+
var my_ref = AStar3D.new() # AStar3D is of type RefCounted
1818
1919
func _ready() -> void:
2020
fun_with_refs()
@@ -24,7 +24,7 @@ This can be extremely handy: you don't actually have to worry about freeing obje
2424

2525
For in-built types like `Color` or `String`, Godot utilizes **value semantics**, this means that when you assign a color or string, it will create always an independent copy.
2626
```gd
27-
var a = Vector2(5, 10)
27+
var a = Vector2(5, 10) # Vector2 is an inbuilt-type
2828
var b = a
2929
b.x = 99
3030
@@ -40,7 +40,7 @@ Well... not really bad. Just bad for beginners. `Object` type can bite you if yo
4040
extends Node
4141
4242
func memory_leak() -> void:
43-
var node = Node.new()
43+
var node = Node.new() # Node is of type Object
4444
4545
func _ready() -> void:
4646
memory_leak()

0 commit comments

Comments
 (0)