playMaker

Author Topic: Destroy self don´t work[SOLVED]  (Read 2887 times)

ph0be

  • Playmaker Newbie
  • *
  • Posts: 2
Destroy self don´t work[SOLVED]
« on: August 19, 2013, 05:03:44 PM »
Dear all,

i already tried the search engine but without success..
I got a small problem:

Today i bought the PlayMaker (looks really fine) and i try to buil a prototype..
So here is my problem:
I wrote a spawner with PlayMaker who moves randomly in an area (x and z is random) and he will spawn a prefab (at the moment a cube ;D) with his own FSM.
The FSM from the cube should do following --> if user click(hit) the cube, the cube dissapear and add some points to the points of the user (the addition works well and also the spawn of it) BUT if i have some cubes here (for example 5) and click on one cube ... EVERY cube will be destroyed but i only want to destroy the ONE who was clicked.

I hope you know what i mean, many thanks in advance for your ideas.
« Last Edit: September 10, 2013, 02:04:37 AM by jeanfabre »

upOwlNight

  • Playmaker Newbie
  • *
  • Posts: 27
Re: Destroy self don´t work
« Reply #1 on: August 19, 2013, 05:59:30 PM »
I'm just an amatuer, but i THINK this is your answer.

When you create an object, store it as a variable (say enemy for example). Now each block spawned will have its own variable called "enemy"
now when you click it you can solo it out based off that variable and destroy only that one.

upOwlNight

  • Playmaker Newbie
  • *
  • Posts: 27
Re: Destroy self don´t work
« Reply #2 on: August 19, 2013, 06:36:07 PM »
actually I think I was wrong there. How about storing what you click on using mouse pick? These two tutorials kinda cover the same thing differently, but they are VERY helpful and not too long.


ph0be

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Destroy self don´t work
« Reply #3 on: August 20, 2013, 04:13:19 PM »
Hey,

thank you ! This helped me alot.
 8)