sync problem "instance_change(...)"

Posted by QtFcx
my task was to be a drop and pick-up system. For the selection system, I did the following: 1. In the initialization object I specified the object that I want to pick up the object that will replace the selected object in the room 2. When I pick up an object a piece of code is executed:

if global.selectedItem = ":::-=null=-"
{
global.selectedItem = "oTestItem"
ItemSelected = instance_change(oDeletedInstance, true);
gms_instance_sync(ItemSelected, is_full | isc_local, "Selected");
}

but alas, for some reason the change of instance occurs only locally and other players in the room do not see the changes. How can this be fixed?

Replies (1)

Last message on 18 Jun 2022

Size43 (Administrator) on 18 Jun 2022, 14:06:51
Instance syncing is not able to sync instance_change. You'll have to work around this by instead doing an instance_destroy, then an instance_create.