Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InstanceBehavior - How does it work? #176

Open
JulianEgbert opened this issue Oct 21, 2023 · 3 comments
Open

InstanceBehavior - How does it work? #176

JulianEgbert opened this issue Oct 21, 2023 · 3 comments
Assignees
Labels
help wanted Extra attention is needed request clarification

Comments

@JulianEgbert
Copy link
Collaborator

In the InstanceBehavior we have the functions create_instance(), update_scene() and maybe_update_scene() which are all public (visible). To my undestanding this node is primarily used within the editor and not during runtime. Therefore connections to this node shouldn't be possible?! Maybe I also just don't understand this Behavior because we haven't used it before...

Documentation is present in the README and I see the point of copying stuff with this. I don't see yet, how I can trigger the update_scene method though. Maybe the code needs better comments in order to understand what it does?

@tom95
Copy link
Contributor

tom95 commented Oct 21, 2023

Indeed, it does not have runtime any significance or API. You would select the behavior, hover its connection menu, and press the special instantiate button at the menu's top.

@JulianEgbert
Copy link
Collaborator Author

But how do you call the other functions? There is only one button. Or are they called automatically?

@tom95
Copy link
Contributor

tom95 commented Oct 21, 2023

Yes, they are all called by various callbacks :)

create_instance when the button in the menu is pressed.
maybe_update when the scene is saved.
update when from maybe_update, if the saved scene is our scene.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed request clarification
Projects
Status: No status
Development

No branches or pull requests

2 participants