itsHasaN Posted April 4, 2023 Posted April 4, 2023 hi, as you may know when we creating an element it will connect to the resource, and that resource will become his parent, and it will get destroyed on resource stop. i am creating an api resource, there is an custom made element, i want to change its creator resource to the resource that used this api resource exported function to create this new element so it dont get destroyed when the api resource stop or restarted. i tried using setElementParent(element, getResourceDynamicElementRoot(sourceResource) ) but the element would still destroy when the api resource stop, any idea how can i achieve this?
Scripting Moderators xLive Posted April 4, 2023 Scripting Moderators Posted April 4, 2023 As far as I know, it's not currently possible. There's already a GitHub issue about this. 1
itsHasaN Posted April 5, 2023 Author Posted April 5, 2023 thanks, i hope we can have this in feature updates, for anyone else that need this, there is a way to achieve this, just create the element in that other resource by createElement and pass it as a parameter to api resource.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now