How do I Object.Use (keepalive) a variant? #119
nii236
started this conversation in
Is this a bug?
Replies: 1 comment
-
As you are doing, you can keep the value alive by calling a function on it ie. b.NodePath.IsEmpty() // keepalive
if Input.IsActionPressed("ui_accept", false) {
// This doesn't panic
b.Super().AsNode().GetNode(b.NodePath.String())
} I've been thinking about automatically keeping alive all Go properties inside Go defined |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Minimum Reproducible Example
I have a NodePath that panics on "expired pointer" whenever I try to access it inside Input.
But if I
fmt.Println
on it first, it doesn't panic.I'm guessing I need to run
Object.Use
onPath.ToNode
. But that type is not a node, it is an instance, so I can not useObject.Use
on it.How do I avoid the expired pointer error on variants?
Beta Was this translation helpful? Give feedback.
All reactions