Skip to content

Is there a way to stop Node.Any Instance types from being created automatically as children when added as a field to a Go extension class? #133

Answered by Splizard
ring-c asked this question in Q&A
Discussion options

You must be logged in to vote

I'm thinking about introducing ID types to solve this, which would be typed Object Instance IDs for each class, which have a boolean on them when you retrieve them to signal whether they are still alive or not, this may also help with #130.

So for example, if I implement this, you would change the field to be this:

	Collision CollisionShape3D.ID

You can set it from the editor, or within the code:

	MyObject.Collision = SomeOtherObject.CollisionShape3D.ID()

Then when you want to borrow the Instance for a single frame:

	shape, stillAlive := MyObject.Collision.Instance()
	if stillAlive {
		// do something with collision shape
	} 

They would be more suitable to use as references, as the Instance

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
5 replies
@ring-c
Comment options

@Splizard
Comment options

Answer selected by ring-c
@ring-c
Comment options

@Splizard
Comment options

@ring-c
Comment options

Comment options

You must be logged in to vote
4 replies
@Splizard
Comment options

@ring-c
Comment options

@Splizard
Comment options

@ring-c
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants