Open vvh413 opened 1 month ago
Thanks for reporting this, I'll have a look at this over the weekend.
I notice you are trying to cast the object to a pointer type gd.As[*gd.Area2D]
. This needs to be a value type for Godot classes. Do you still run into the problem if you use gd.As[gd.Area2D]
?
Yes, the same behavior with gd.As[gd.Area2D]
. Just checked, this problem appears even without any casts, with just empty handler. If i create Area2D
and connect area_entered
signal to my handler via editor, everything works fine. So probably it is something about Connect
in Go.
Thanks for the additional information, I think this is an issue with Go Callables that accept class arguments. I suspect gd
is incorrectly taking ownership of the arguments and freeing them when it returns.
Hi. I have encountered some strange behavior of Area2D, while trying to handle area intersection with
area_entered
signal.Here is some code fragment with connect of
OnAreaEntered
handler to signal:This code results to this:
https://github.com/user-attachments/assets/30b0beaf-e10e-4600-818d-8374615cd476
So after
OnAreaEntered
handler, enteredInteractiveArea
just disappears.InteractiveArea
is customgd.Ared2D
This might be related to #44, because if I trying to cast the entered object to
*gd.Area2D
instead of*InteractiveArea
, I'm gettingnil, true
as a result.Also this is probably related to #53, because it's actually the same project and I can't take
gd.Area2D
as handler argument because of panic:I was able to workaround this by using
gd.Object
as handler argument or by replacingInteractiveArea
to a manually createdArea2D
withCollisionShape2D
in editor: This also fixedi.Area.GetOverlappingAreas
method. But area disappears anyway afterOnAreaEntered
handler or after taking area fromgd.ArrayOf
by index.Initially I was trying to connect two signals
area_entered
andarea_exited
like this:But this resulted in an error about trying to remove child from busy node or something. Here is the log file error.log