Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: white on November 30, 2011, 02:35:46 PM

Title: Setproperty > Correct Usage ? [SOLVED]
Post by: white on November 30, 2011, 02:35:46 PM
What is the correct usage of "setproperty" ? Seems like I am unable to access most of the properties of the dropped objects. I've tried it with 3D Text (to change the "text") and particles (to switch off the emit) but seems like they are just not there.

Thank you.
Title: Re: Setproperty > Correct Usage ?
Post by: Alex Chouls on November 30, 2011, 03:52:09 PM
You have to drag the Text Mesh component from the Unity inspector onto the Target Object field. You'll then see all the public properties in that component.

Object in this context refers to a UnityEngine.Object, not a GameObject. This means you can manipulate anything derived from UnityEngine.Object. Create an Object variable, select it, then look at the Object Type popup to see the full list!

Does that help? I need to make a quick screencast to show this off. It adds a lot of power to Playmaker, but I think most people will try to reference a GameObject instead of Components etc.
Title: Re: Setproperty > Correct Usage ?
Post by: white on November 30, 2011, 08:44:02 PM
Oh ! This helped !
How about the usage with prefabs / spawned objects ?

Thank you !
Title: Re: Setproperty > Correct Usage ?
Post by: Andrew.Lukasik on December 03, 2011, 06:38:13 PM
Quote from: white
How about the usage with prefabs / spawned objects ?

I've the same problem. I proposed possible solution/fix here: http://hutonggames.com/playmakerforum/index.php?topic=887.0

*Using <Has Component> on spawned object and then storing positive result as Object (for later use with <Set Property>)
Title: Re: Setproperty > Correct Usage ?
Post by: Alex Chouls on December 09, 2011, 07:25:24 PM
I posted a Get Component action here:
http://hutonggames.com/playmakerforum/index.php?topic=910.0

You can use this to get components at runtime.

Let me know how that works for you.