Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Zenneth on June 04, 2012, 02:35:46 PM
-
Let say that I have a C# script with the following variable within a class
float m_Height;
Assumed that the variable was properly declared, have proper value, and attached to a GameObject,
How do I reference that variable, so that I can use it in Playmaker?
-
Hi,
1: your class will have to be a monobehavior,
2: you'll need to make that variable public, and then you can use the "get Property" to get it from that script and store it in a Fsm variable,
3:You can create an "object" variable, select its type to be of your script class, and drag and drop that component onto this variable, and in the "get property" action, you reference that "object" variable, and your variable will be listed
If that's not clear, I'll make a working example.
Bye,
Jean
-
Hi Jean,
I tried to do it but couldn't get it to work.
It would be great help if you can provide me with a sample project.
Thank you,
-
Hi,
ok, please find a working example, modifying the camera FOV using the Fsm Object and set property technic.
NOTE: an action is available to so this ( set camera FOV) this is just to illustrate usage with a very simple example.
If you have more questions, do not hesitate.
Bye,
Jean
-
ok, please find a working example,
The reason I asked in this thread, is because I cannot find a working sample.
-
Hi,
I have attached a working example to that post, you need to download it and then you'll have your working example.
Here's the link in case you don't see it:
http://hutonggames.com/playmakerforum/index.php?action=dlattach;topic=1701.0;attach=986 (http://hutonggames.com/playmakerforum/index.php?action=dlattach;topic=1701.0;attach=986)
Bye,
Jean