Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: kogi180 on April 15, 2019, 10:37:38 AM

Title: I want to prevent deletion of objects set in array list
Post by: kogi180 on April 15, 2019, 10:37:38 AM
First of all, I apologize for being hard to convey because I use machine translation
It may be a stupid question, but when an object set in array list is deleted from the hierarchy, the same object set in array list will also be deleted
Is it impossible to delete from the hierarchy without deleting it from the array list?
Title: Re: I want to prevent deletion of objects set in array list
Post by: tcmeric on April 15, 2019, 11:20:25 AM
Hello. Your question is clear. The array list has a reference to the hierarchy object. Therefore, if the hierarchy object is deleted, the array list is referencing nothing. An array list does not actually hold an object, but instead only has a reference.

Sometimes, it is better to reference prefabs in your project folder. Then your scene objects will not affect your array list (since you cannot delete a prefab during game play).
Title: Re: I want to prevent deletion of objects set in array list
Post by: kogi180 on April 15, 2019, 02:05:02 PM
thank you for answering
I hoped that it could be possible but hopefully this solved it
Thanks also for the advice
Title: Re: I want to prevent deletion of objects set in array list
Post by: djaydino on April 15, 2019, 03:10:17 PM
Hi.
If you need the same object to come back regularly you might want to disable instead of removing the object.
This way it will also keep the reference in the array.

But it depends on you project.
Title: Re: I want to prevent deletion of objects set in array list
Post by: kogi180 on April 16, 2019, 03:13:49 PM
I am not yet familiar with the playmaker or the program so I can not easily answer the question which is the best for the challenge now
But I want to try variously based on the advice I got
Thank you