playMaker

Author Topic: Activate/Deactivate Objects  (Read 2306 times)

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Activate/Deactivate Objects
« on: April 02, 2014, 11:13:02 AM »
Hi!

How can I deactivate more objects with one action?
I have some blue coins, and I need to deactivate them all.
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Activate/Deactivate Objects
« Reply #1 on: April 02, 2014, 11:48:11 AM »
Hey Ragabast. If you have them all as children to one parent, you can deactivate the parent to make the rest go away.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Activate/Deactivate Objects
« Reply #2 on: April 02, 2014, 11:53:41 AM »
Yes, I found that out. :-)

But if I want to disable a FSM in all the coins with one action then?
Then I maybe need to store it in a variable or something. It's exactly this I want to do. :-)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

JonathanBurroughs

  • Junior Playmaker
  • **
  • Posts: 73
  • Some kind of independent game developer
    • @HiFiHair
Re: Activate/Deactivate Objects
« Reply #3 on: April 02, 2014, 12:18:46 PM »
I only discovered this yesterday, Rabagast, so I'm super happy to share the knowledge.

What you want, I think, is "Set Property".

You can specify a specific component if you wish. For example I turn FSMs on and off within my Player object, but leave things like the Mesh Component and Physics components switched on.

You can go even further and manipulate specific Inspector entries. It's super powerful.

In fact as a shortcut you can just drag objects from the Hierarchy or components from the Inspector directly into a state and playMaker will automatically suggest using Set Property.

Hope this helps!

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Activate/Deactivate Objects
« Reply #4 on: April 02, 2014, 12:47:53 PM »
You can also set the objects with a specific tag to an array and use the action Enable FSM which can also disable FSMs.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Activate/Deactivate Objects
« Reply #5 on: April 02, 2014, 02:17:10 PM »
sebaslive:
I don't know how to use Array yet.

HiFiHair:
Can you disable FSM on more than one object with this?

I can explain a little bit more details of what I want to do.

I have coins to pick up with 3 different colors. For example, 5 blue, 5 green and 5 red. But I only can pick up the coins with the same colors before I can pick up the other coins. But I can choose which color I can pick up first. If I try to pick up red before i'm finish with blue, something bad will happen....maybe! :)

Do you understand what I want?
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no