0 votes

So basically I found this code:

instance_from_id()

What does this mean? and also how can I find the id of the instance?

in Engine by (23 points)

1 Answer

0 votes

It retrieves an instance of an object whose id you provide as a parameter. So you could for example iterate over your objects and save their id's in array by using: get_instance_id function. And if you needed an object you could retrieve it with instance_from_id function.

Both functions are documented here:

https://docs.godotengine.org/en/3.1/classes/class_object.html

And they are both inherited by basically all objects in godot.

by (699 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.