You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Godot v4.2.2.stable - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3050 Ti Laptop GPU (NVIDIA; 31.0.15.5222) - AMD Ryzen 9 6900HS with Radeon Graphics (16 Threads)
Issue description
When working on my snake project, I had used this lambda in _ready():
func_ready() ->void:
hurtbox.area_entered.connect(func(area: Area2D) ->void:
ifareaisCollectable:
varcollectable: Collectable=areaasCollectable#CRITICAL This doesn't work without "self". Engine bug?self.add_segment.call_deferred(false)
collectable.collect()
)
When the self in self.add_segment.call_deferred(false) is removed, there is an error, which appears to say that the object calling this method doesn't exist! What the function does isn't too relevant, because a friend reproduced the error with minimal effort (as seen below in the steps to reproduce).
You'll be met with this error when you press the key:
You'll also notice in the debugger that all of the object's properties are missing (this might not be a part of the bug, though), and only the properties from the lambda are shown.
Adding self before do_thing will also cause the issue to vanish.
Tested versions
System information
Godot v4.2.2.stable - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3050 Ti Laptop GPU (NVIDIA; 31.0.15.5222) - AMD Ryzen 9 6900HS with Radeon Graphics (16 Threads)
Issue description
When working on my snake project, I had used this lambda in
_ready()
:When the
self
inself.add_segment.call_deferred(false)
is removed, there is an error, which appears to say that the object calling this method doesn't exist! What the function does isn't too relevant, because a friend reproduced the error with minimal effort (as seen below in the steps to reproduce).Steps to reproduce
Simply use this code in your project:
You'll be met with this error when you press the key:
You'll also notice in the debugger that all of the object's properties are missing (this might not be a part of the bug, though), and only the properties from the lambda are shown.
Adding
self
beforedo_thing
will also cause the issue to vanish.Minimal reproduction project (MRP)
Lambda Reproduction Project.zip
The text was updated successfully, but these errors were encountered: