Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: PlayU on November 12, 2014, 11:43:33 PM

Title: Using playmaker to script input for mechanim animation[SOLVED]
Post by: PlayU on November 12, 2014, 11:43:33 PM
Hey,
  I have my animator set up with the Speed and Movement floats.  I just want to have to press the "w" key for my character to walk and "r" key to run.  Do I use the get key function for the animator..don't know where to start.
Title: Re: Using playmaker to script input for mechanim animation
Post by: cmonroy on November 20, 2014, 03:02:55 PM
Simple: set the speed variable to 1 when W is pressed and to 0 when is not. Do the same with R, but set the speed to 2 when pressed and to 0 (or 1) when not...

From the action browser, use the GETKEY to check if the desired key is pressed or not. Use the TESTBOOL to test its value. If TRUE, send the flow to another state to assign the corresponding value to animator variable with ANIMATORSETFLOAT and return to the listener state; do the same when FALSE but reset the values to 0 in another state and then return to the listener state (the one which "listens" for the key pressed.
Title: Re: Using playmaker to script input for mechanim animation
Post by: PlayU on March 02, 2015, 08:06:15 AM
Thank you cmonroy! :)