Playmaker Forum

PlayMaker Feedback => Feature Requests => Topic started by: Duffer on March 10, 2017, 04:37:09 AM

Title: Get (public, monobehaviour) Class Variable Value from GameObject[SOLVED]
Post by: Duffer on March 10, 2017, 04:37:09 AM
I must admit I thought the Unity.Object Get Property action did this... but i dont think it does now.  Nor does the Get Component action.

If I am wrong on this and/or there is an easy way to achieve this (rather than putting Fsm Variables on the GO in the first place) then please someone explain (in detail please!).

Otherwise, I think variations of this potential Action are a must-have enhancement?

Title: Re: Get (public, monobehaviour) Class Variable Value from GameObject
Post by: jeanfabre on March 10, 2017, 04:49:24 AM
Hi,

GetProperty and SetProperty work fine as far as I can see.

 can you be more precise on what component and property you are trying to reach?

 Bye,

 Jean
Title: Re: Get (public, monobehaviour) Class Variable Value from GameObject
Post by: Duffer on March 10, 2017, 04:57:38 AM
Maybe im not using it correctly.

So I've created a monobehavior class called RPGBaseInfo.

Within that class I've created a public string title; variable.

I've dragged that on to a empty gameobject I've created in scene.

I've created an fsm on the go and in the first state I want to add an action to garner the value of that string to an fsm string variable  (keeping it simple).

But Get Property doesn't seem to recognise either the above class or title public variable when i drag in the go at the start of the Get Property action?
Title: Re: Get (public, monobehaviour) Class Variable Value from GameObject
Post by: jeanfabre on March 10, 2017, 05:01:08 AM
Hi,

 can you show me your getproperty action screensho, likely you are dragging the go, which gives you access to the gameobject property, but you need to drag the actual component!

 Bye,

 Jean
Title: Re: Get (public, monobehaviour) Class Variable Value from GameObject
Post by: Duffer on March 10, 2017, 07:05:26 AM
Hi Jean,

Forgive my dumbness!  Now see how to lift those variables from the relevant GO monobehavior class.... thanks!
Title: Re: Get (public, monobehaviour) Class Variable Value from GameObject
Post by: jeanfabre on March 11, 2017, 02:26:42 AM
Hi,

 no worries!! :)

 Bye,

 Jean