Playmaker Forum
PlayMaker Help & Tips => PlayMaker Tips & Tricks => Topic started by: redikann on February 23, 2015, 12:25:06 PM
-
Something I started doing that worked based on a hunch, start sending Playmaker variables that I wanted to track per frame with no interruption to the Animator. So I created a controller called 'Variables' and attach it to my Gameobject leaving the Avatar null.
Now for example I could use a 'Get axis vector' and send the input to the animator with x,y,z floats and a magnitude float. From any other FSM I could retrieve those variables. You could do this with the 'StateMachine variable' actions but that entails not forgetting where things are when logic starts to pile up.
-
Hi,
Interesting!
Could you share an example? or do you intend to distribute it via the asset store?
Bye,
Jean
-
It is all done with what Unity has built in. I attach an animator component to my object and then create a Controller for it that I call 'Variables'. I don't bother giving it an Avatar. With that setup and the Playmaker Animator Actions I can start sending it information in variables . Now I have an easy way to look and watch in real time during play and other gameobjects can see this information.
I could have an FSM that only updates my Health to the Animator controller and any other Game object could look at that variable.
-
It is all done with what Unity has built in. I attach an animator component to my object and then create a Controller for it that I call 'Variables'. I don't bother giving it an Avatar. With that setup and the Playmaker Animator Actions I can start sending it information in variables . Now I have an easy way to look and watch in real time during play and other gameobjects can see this information....
;D TUTORIAL! TUTORIAL!
-
I don't currently have a need to track variables on a per frame basis. However it did intrigue me enough to try it out.
The simplified version is:
-Install Mechanim addon actions
-Create EmptyGameObject
-Add an Animator Component
-Add an Animation Controller to the Animator component
-Create the Parameter variables you wish to track on per frame basis in the Animator under Parameters
-Create a Playmaker FSM on the Empty GameObject (any variables sent to and from this will be updated on a per frame basis)
-Use Set Animator Bool, Float, Int, Trigger actions locally
Then on your object where your interested in reading those variables
-Create Empty GameObject called DestinationGameObject
-Create FSM
-Use Get Animator Bool, Float, Int, Trigger action. Change GameObject from "Use Owner" to "Specify Game Object", and select the Empty GameObject
-Ensure that parameter names both match "EmptyGameObject" and "DestinationGameObject"
-Store the results like normal
-
Would be neat if someone made a tutorial for that.