playMaker

Author Topic: Adding a Jump to Character[SOLVED]  (Read 5944 times)

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
Adding a Jump to Character[SOLVED]
« on: October 24, 2013, 10:52:55 PM »
Hello! I've been developing my first game with PlayMaker and it's great. I've been able to intuit a lot of the issues I've encountered, and use logic to overcome several obstacles, it's a blast.

However, I'm having some trouble adding a character jump to my existing setup and I just can't seem to figure it out. Following the standard YouTube tutorials (which were great), I've since moved on to setting up more complicated FSM's. [The tutorial I used is located at http://www.hutonggames.com/tutorials_game_design_with_playmaker.php]

 I'm still using that existing character setup, which works perfectly, except I'm unable to add a jump. I've read on here and other forums that I can drag the character motor to a SetProperty action (which is tied to a getbutton action, etc), and activate the jump within SetProperty. Problem is, following the tutorials, I used a "character simple move" action (rather than CharacterMotor), which does not have a jump variable when dragged into the SetProperty action. I tried replacing the Playmaker "character simple move" action with a "character move" Playmaker action, but still no jump variable is accessible through SetProperty.

I'm really pleased with how my current FSM's handle character motion, so if it's even possible, I'd love to just add a jump, but if the only option is to start with a new character movement FSM, I'd be happy to do so. I have a "Character Jump" FSM, with an animated float variable, but I'm unsure how to connect the character's Y height with the animated float.

Any ideas? I'm so thankful for any input (no pun intended)

Settings on the FMS responsible for movement: http://i40.tinypic.com/f44840.jpg
A shot of the "character simple move" component attatched to character: http://i42.tinypic.com/t06fc6.jpg
Current attempt at adding a jump through separate FSM: http://i41.tinypic.com/r2nb43.jpg
« Last Edit: October 31, 2013, 03:47:33 AM by jeanfabre »

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
Re: Adding a Jump with Controller.Move
« Reply #1 on: October 27, 2013, 02:25:26 PM »
I think maybe my original post was too long, or too confusing - sorry!

I'm using the default Unity "character controller" component, which Playmaker gives you the option to add when you attempt to assign a "character simple move" or "character move" Playmaker action.

I've read on this forum that the best way to add a jump is to use a "set property" Playmaker action, on the Unity "character motor" component - but my setup does not appear to have a character motor component. Dragging the "character controller" component into the "set property" action doesn't provide any access to a hidden "jump" property.

Can anyone help me find a way to add a jump to a character controller, either through "SetProperty", or through another method entirely?

Thanks again!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Adding a Jump to Character
« Reply #2 on: October 28, 2013, 08:49:29 AM »
Hi,

 jumping a character controller without a Character motor is a matter of either

-- moving manually the gameobject up ( using "translate" or "set position")
-- add force to the gamobject if it's a physic gameobject.

bye,

 Jean

intrikit

  • Full Member
  • ***
  • Posts: 132
    • Defiant Child
Re: Adding a Jump to Character
« Reply #3 on: October 29, 2013, 02:09:08 AM »
Or adding a controllable Jump animation with root motion

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
Re: Adding a Jump to Character
« Reply #4 on: October 30, 2013, 12:24:13 PM »
Hey, thank you both for your input!

I went back to a previous project where I had a character controller and a working jump. I copied over the default "charactermotor.js" script into my new project and attached it to my existing controller. I had to modify the script to counter the double movement, but in the end it worked really well!