playMaker

Author Topic: [SOLVED]Control component actions?  (Read 1405 times)

DARK_ETERNAL

  • Full Member
  • ***
  • Posts: 111
    • View Profile
[SOLVED]Control component actions?
« on: November 21, 2012, 07:04:07 AM »
Greetings.

I was wondering... Playmaker has default actions to get a component and such stuff, but... Does it have any other to, let's say, turn on/off a component? I guess I'd have to write a custom action for custom components,  but as for primitive components, is there any action?

Thanks in advace.
« Last Edit: November 22, 2012, 12:35:40 PM by DARK_ETERNAL »
Check out our new game: Nitro Chimp. Now live in App Store!

Trailer:
Download: https://itunes.apple.com/app/nitro-chimp/id557150450?l=en&mt=8

kiriri

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: Control component actions?
« Reply #1 on: November 21, 2012, 08:30:40 AM »
use get component to save the component as an object. Define the object variable to exactly the object variable type you need (like UnityEngine/MeshRenderer for example, you do that in the same tab where you create the object variable, just create it, select it and you should have the option to define it), Then use set property and set "Inherited-> enabled" to false on that object variable.

If the component is on the same gameObject as the FSM, or if the FSM-gameObject is not a prefab , you can also just drag the component from the inspector onto the content of your state (where all your actions go). After releasing the mouse button there you should get to choose whether you want to set or get any property on that object (component).
« Last Edit: November 21, 2012, 08:34:10 AM by kiriri »
Best,
Sven

DARK_ETERNAL

  • Full Member
  • ***
  • Posts: 111
    • View Profile
Re: Control component actions?
« Reply #2 on: November 22, 2012, 12:35:18 PM »
I see... Quite good. Thanks kiriri.

Marking as solved. It worked as kiriri said.
Check out our new game: Nitro Chimp. Now live in App Store!

Trailer:
Download: https://itunes.apple.com/app/nitro-chimp/id557150450?l=en&mt=8