Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Tkfore21 on July 27, 2013, 04:01:15 PM

Title: Question about using random objects [SOLVED]
Post by: Tkfore21 on July 27, 2013, 04:01:15 PM
I'm trying to choose a randomly picked object and make it visible. However there seems to be a piece of logic- i.e. Playmaker Action, which I can't find, and I'm hoping someone can point me in the right direction.
How it's setup:
- I have five objects, all set to "not-active" in Inspector, and I've setup an FSM with the "Select Random Game Object" Action as one of the states.
- I set the "Game Objects" value to 5 at the top.
- I add the five objects in the fields and change the Weight to 1 for all of them so they have the same chance of being picked.
- Store the results as a variable I created with it designated as a "GameObject".
- Set the transition to "Finished" and point it to a new State.

I now want to be able to use the PM Action "Set Properties" on that one randomly chosen object to make it active and visible.  I created a new state in the FSM and can't figure out how to choose the object from the variable.
If anyone can help, I would greatly appreciate it.
Title: Re: Question about using random objects
Post by: KozTheBoss on July 27, 2013, 04:21:18 PM
you should be able to simply use "activate gameobject" and use your variable as the reference for which object to activate :)

Unless i misunderstood your situation, which is quite possible
Title: Re: Question about using random objects
Post by: Tkfore21 on July 27, 2013, 04:28:47 PM
Thank you!
You just help figure out the last piece I needed for one of the game modes I'm working on.  53 days to go.
Title: Re: Question about using random objects [SOLVED]
Post by: KozTheBoss on July 29, 2013, 10:37:35 AM
You're welcome! Glad to be of help :)