Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: holyjewsus on April 17, 2011, 04:10:14 AM
-
I want to create a slider (done)
when the slider goes up I want to create a series of trees (done)
When I move the slider down I want to destroy those tree objects(???)
I'm using a find closest gameobject action with my spawn object as the object to look near, storing this in a variable and then a destroy game object action on that stored variable... the actions fire correctly but nothing happens to my trees.
also sometimes I get an error in the console, no transition to kill state(my destroy state) seems like the find closest action isn't storing anything.
any clues or better way to do this?
-
I would parent the created trees to the spawn point, then use Get Child Count and Get Child Index to destroy the trees as the slider goes down - essentially using the scene hierarchy as an array...
Not sure why find closest wouldn't work, but this sounds like a good screencast/sample so maybe I'll give it a go myself...
-
I feel foolish but where is child index?
-
OH, get child num?
-
Yes - sorry!