playMaker

Author Topic: How to delete objects clicked by mouse  (Read 1240 times)

willchocks

  • Playmaker Newbie
  • *
  • Posts: 1
How to delete objects clicked by mouse
« 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

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: How to delete objects clicked by mouse
« Reply #1 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).