Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: ph0be on August 19, 2013, 05:03:44 PM

Title: Destroy self don´t work[SOLVED]
Post by: ph0be 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.
Title: Re: Destroy self don´t work
Post by: upOwlNight 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.
Title: Re: Destroy self don´t work
Post by: upOwlNight 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.

Title: Re: Destroy self don´t work
Post by: ph0be on August 20, 2013, 04:13:19 PM
Hey,

thank you ! This helped me alot.
 8)