Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: DARK_ETERNAL on November 21, 2012, 09:04:07 AM

Title: [SOLVED]Control component actions?
Post by: DARK_ETERNAL on November 21, 2012, 09: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.
Title: Re: Control component actions?
Post by: kiriri on November 21, 2012, 10: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).
Title: Re: Control component actions?
Post by: DARK_ETERNAL on November 22, 2012, 02:35:18 PM
I see... Quite good. Thanks kiriri.

Marking as solved. It worked as kiriri said.