playMaker

Author Topic: Newbie Question on Actions  (Read 2244 times)

Ryandb2

  • Playmaker Newbie
  • *
  • Posts: 4
Newbie Question on Actions
« on: April 02, 2016, 07:51:49 PM »
So I just got playmaker and am loving it so far. But I am struggling with something basic that I couldn't find an answer to (probably just not sure what to even look for).

I have a basic player character, I want an initial state of idle with an idle animation, and a state of walking with a walking animation, the state change will happen when the character starts or stops walking. Since I am using a character controller, I can't gauge forces so I am just focusing on if movement keys are pressed, though there might be a better way, like getting velocity from the controller. But I can't seem to get it to work and I think it has to do with the order my actions execute (or lack thereof).

I have the following actions on the walking state:
-Animation
-4 KeyDown (W,A,S,D)
-Bool None True

I put the KeyDown's in boolean locals and pass them to Bool None True and tell Bool None True to return to idle if none of those keys are pressed. But basically it seems to always be returning to idle. My initial thought was that the evaluations were happening too soon, before the locals had been set. So I set the Action Sequence toggle and put Bool None True at the end. But when I do that, the actions never get past the animation action and it just stays in the Walking state.

This is my first day with Playmaker so I am sure I am doing something dumb. If I were to code this it would be the following in pseudo:

if(!isKeyDown(W) && !isKeyDown(A) && !isKeyDown(S) && !isKeyDown(D))
Idle();


mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Newbie Question on Actions
« Reply #1 on: April 02, 2016, 08:16:02 PM »
Since you are using a Character Controller you can use these two actions together to move your character


You can use the magnitude to set an animator controller float parameter to control which animation state is played- idle--->walk<---idle
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

Ryandb2

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Newbie Question on Actions
« Reply #2 on: April 02, 2016, 11:39:48 PM »
Thanks for the help, I was able to get this working with your approach. Any thoughts on why my approach didn't work? Just trying to understand where my logic went wrong. (not specifically the character movement but rather why having the 4 KeyDown actions and the Bool None True action didn't work).

Thanks!

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Newbie Question on Actions
« Reply #3 on: April 03, 2016, 12:20:21 AM »
Seems like it should work from looking at the states- no idea really-
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

Zeldag

  • Full Member
  • ***
  • Posts: 198
Re: Newbie Question on Actions
« Reply #4 on: April 03, 2016, 07:29:15 AM »
Hi,

I was wondering if there is a 'every frame' tick box on the none bool true action (cant remember and the bottom of the action is cut off in the screenshot). If so, that may need to be ticked (i think the coding equivelent of every frame is 'on update') for the bool to keep getting tested over and over.

 Also it may help with the investigation if we knew what was in the idle state.

Good luck with it!

Ryandb2

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Newbie Question on Actions
« Reply #5 on: April 03, 2016, 02:05:18 PM »
Every Frame was ticked, oh well enough investigating as I have wasted enough of your time :)

I appreciate the help and if I run into a similar issue again I will post.

Thanks for getting me up and running!