Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: willchocks on April 11, 2018, 10:47:44 PM

Title: How to delete objects clicked by mouse
Post by: willchocks on April 11, 2018, 10:47:44 PM
Hi,

I'm new to PlayMaker,
Just having a bit of trouble with an app i'm developing in unity.

During run-time, I want to click a 3D object in my scene to delete it.
The problem is that anything I click is deleted: (ground plane, GUI elements, walls etc.)

At the moment, I have a DeletionManager in my scene which contains the FSM for deleting objects at run-time.

When an object is clicked, it is added to a global variable called 'deletable'.
GameObjects in 'Deletable' are then destroyed.

How do I only add objects with a specific tag to 'deletable?  :-[ :-[

Thanks
Title: Re: How to delete objects clicked by mouse
Post by: tcmeric on April 12, 2018, 12:06:06 AM
Before it is deleted, you should save the game object to a variable. Then, do a "game object tag compare" to make sure its the object you want to delete (by tag).