Instance Owner

Posted by Chibi
I'm trying to sync the instance with the var owner, but what seems to happen is that it says that the variable hasn't been found.
What can I do to fix this ?
Thanks in advance, Chibi!

Replies (3)

Last message on 12 Dec 2017

Size43 (Administrator) on 3 Dec 2017, 13:38:47
Please post the code that you're using.
Chibi (Topicstarter) on 4 Dec 2017, 19:13:28
So I instanciate a obj called oBomb and then I sync the var owner by using i = instance_create(x,y,oBomb);
gms_instance_sync(i, is_onetime,"heat","timer","owner");
after that the bomb explodes and the explosion is created by a script I've made using arrays.
but when the player collides with the explosion it says that the var owner isn't "synced".
Is this due to the fact that I haven't referenced it again the sync of the var owner once again on the oBomb ?
Size43 (Administrator) on 12 Dec 2017, 12:11:04
If you're using GM:Studio, you'll need to use gms_instance_sync_var_add. Please see the instance syncing tutorial for more info.

Also, the 'owner' variable is automatically set for all synced instances. You don't need to set it manually. If you're seeing an error about owner not being set, the instance has not been synced at all.