Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: bigzer on March 23, 2012, 09:09:10 AM

Title: Character Motor Jump? [SOLVED]
Post by: bigzer on March 23, 2012, 09:09:10 AM
Hi there,

I'm working on a character controller and I have a question concerning the Character Motor:

In the inspector character motor I see they mention "Jumping".
I'm not a scripter but I beleve the character motor script is listening and waiting for an input to perform a jump based on the parameters given in the inspector.

I don't find any action to fire it up (the jump). Am I missing something?

Using the "controller move" action I can move my character along the Y axis but obviousely it requires a lot of additionnal code to make it feel right, work that I think has already been crunched by Unity in the Character Motor script.

I had a look at Artician CharacterMotor and PlatformController actions but they dont have this feature unforunately.

Thanks for your insight :)

Title: Re: Character Motor Jump?
Post by: justifun on March 23, 2012, 10:40:39 AM
You actually just choose which button jumps via the player input preferences of unity itself.  Its joystick button 0 i think by default.

Then you would piggyback on top of that and use a "get button down" playmaker action to perform whatever you want along with that jump. eg: play animation.

does that make sense?

unity itself handles the jump of the character motor script.

also, one use of the character motor action is to disable jumping,  you can add it to a state and un-check the check box, and your controller will no longer be able to jump (eg: while he's standing in tar or something)
Title: Re: Character Motor Jump?
Post by: bigzer on March 25, 2012, 12:57:21 AM
Thank you for your answer.

I use this method but it doesnt seems to send anything to the character motor script.

In project settings/input I linked the Jump to mouse 0 (both jumps actually because there are 2).

I made a verry symple test attached to an empty game item, basically my start state is a 'get button down' with as button name 'Jump' and send event 'loop' to go back to the start state once pressed and listen for a new 'get button down' again.

When I run the game I can see that it registers the mouse click (I see the loop working in green in the playmaker fsm editor) but nothing happens, no jump at all.

I disabled playmaker scripts from my character and I reset to default the charactermotor inspector's config to no avail.

I probably miss something here but what's the catch here Oo?

Thank you for your help

Title: Re: Character Motor Jump?
Post by: bigzer on March 26, 2012, 02:23:04 AM
Following up,

It works when I replace the Character Motor Script with the Third Person Controller Script.
Sadly I need the Character Motor Script and not the Third Person one :(

Anyone got some ideas of what's going on here?
I'm loosing my marbles on this one ><

Title: Re: Character Motor Jump?
Post by: bigzer on March 26, 2012, 02:53:53 AM
Found it...

I didnt know I had to add an input controller script...
Thx anyway :)
Title: Re: Character Motor Jump? [solved]
Post by: justifun on March 26, 2012, 12:03:42 PM
Glad you found a solution...

So what was final setup that worked?

Title: Re: Character Motor Jump? [SOLVED]
Post by: iPetProjectDev on May 22, 2012, 06:56:51 PM
Cool. SOLVED..Good to know..but what was the solution as I am having the exact same problem and I already have a series of Fsm's that look like they step all over the input scripts in the Standard Assets. I hope we can get a proper SOLVED answer here about how to do this with an Fsm. I have the max and default speeds calculated at load by an Fsm which uses those values to drive a CharacterController and animation graph as per the tutorial series. It worked dandy. Now I added the CharacterMotor script and made a Jumper Fsm. The first state listens for a GetKeyDown event with the Space bar (tried it with no Fsm and of course it doesn't just work) which if true forwards to a Jump event. I have looked through the Actions and downloaded some here but there is no obvious way for me to tell the controller to jump when I do the bool test and advance to the state where the jump is made to occur. I can dynamically set the height, the acceleration in air and whether they get any further with a second hit of the space bar but I just want it to jump. The other input scripts do not use my controller scheme and I am also using the MasterCamera rig from the Assets Store so I am not stepping on that nice little piece of codework either with one of the standard scripts either.

What is the trick here using just Fsm's? (so this can properly be marked [SOLVED]).

Title: Re: Character Motor Jump? [SOLVED]
Post by: iPetProjectDev on May 22, 2012, 09:14:39 PM
The trick here is really simple. You create the GetButtonDown listener action for the button controlling the jump. If TRUE then pass to the Jump event. The Jump event is wired to a State I call SendJumpMessage. I then SIMPLY dragged the CharacterMotor Component onto that State and chose the SetProperty. It gave me the inputJump boolean just like I needed. I set it using the GetButtonDown variable I originally stored in that action and then looped the outputs back to the GetButtonDown listener.

HTH anybody stuck with this. It also just opened my eyes to the wonders of dragging and dropping  my scripts onto the Fsm's and controlling them from there.. Like wow!

Title: Re: Character Motor Jump? [SOLVED]
Post by: shinodan on December 05, 2012, 05:20:37 AM
Sorry im bumping this but i cant get this method to work as explained and being able to do this would work wonders for me.

Ps - Please please please help me lol
Title: Re: Character Motor Jump? [SOLVED]
Post by: Eirestudios on December 14, 2012, 08:29:41 AM
I'm also having problems with this, once I drag the script and use SetProperty and the target object i use is my player but it doesn't give me the inputJump boolean, can anyone help me out with this? Thanks in advance  ;D
Title: Re: Character Motor Jump? [SOLVED]
Post by: jeanfabre on December 14, 2012, 10:46:40 AM

 have a look at this: (

the inputJump bool is definitly there for a CharacterMotor component.