playMaker

Author Topic: (Solved)there HAS to be a way to JUMP with Character Controller in 2020...right?  (Read 7844 times)

Qbanyto

  • Full Member
  • ***
  • Posts: 137
  • Vista Larga, Paso corto
Hey Dj, so I got the jump working from the video above but it’s messing up my animations and movement directions (relative to camera).

I guess I’ll try the rigid body route.wish me luck!

Qbanyto

  • Full Member
  • ***
  • Posts: 137
  • Vista Larga, Paso corto
Using rigid body just glitches out my animation.

I also tried using “translate” action script to get my character to jump. Still no success. Sigh....

nuFF3

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 74
  • Are we even real?
    • One Month Studio
What method are you using to control your animations?

Qbanyto

  • Full Member
  • ***
  • Posts: 137
  • Vista Larga, Paso corto
I didn’t realize you Responded. I had pm’ed you about this.

So in my third person camera system I use the free look style like most third person games do. So player directions movement is relative to camera position. (Which is Great) 

My animation is triggered by the inputMagnitude Parameter in the animations module.

I now implemented your jump system which to me is very important since I’m making a 3D platformer. I’m willing to keep the jump and fix the controls lol.



What method are you using to control your animations?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Hi.
Controller Simple Move will not work.

If you use Controller move, you should be able to manipulate the Y velocity.
I think its best to have Controller move in a separate fsm and setup like this :

Fsm 1 :



Fsm 2 :


(you can adjust multiplier for faster movement)

Fsm 3 :



On Check grounded you will need a fms bool test (found on the Ecosystem)
The Playmaker Tween can be found Here
You also need to make a fsm to check grounded (that fsm depends on how you want to check)and have it set a variable if grounded or not.
And on Set Gravity/Grounded value you need to use a Set Fsm Float to adjust the value on the Move Handler FSM.

Before you do, you might want the have a look at this :
https://medium.com/ironequal/unity-character-controller-vs-rigidbody-a1e243591483

To animate you will probably do that best in a separate fsm as well.
You can Send a event to that fsm from the 'gravity animator' on the Animate jump state.

Then to animate you can use Animator Play. or use a 'Set Animator Trigger' (I prefer to minimize using Parameter in the animator).
Then you probably also need to check for grounded (probably 1st if 'not' grounded, as it needs to start the jump) then when grounded you can play a 'Land' animation for example.

Qbanyto

  • Full Member
  • ***
  • Posts: 137
  • Vista Larga, Paso corto
Thank you so much. I will try this as soon as i get home from work.

Why do you minimize using parameters? Is it unstable? Just curious.

Also what are the actions inside the move handler fsm: Idle & don’t move events (i notice they are not tethered) and the two right ones in the gravity animator fsm? I just want to replicate everything you have so I can get this working. 

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Hi.
In move, they are just empty.
But you can send an event if you want the player not be able to move
(for example on cinematics, talking to npc etc)

the other ones i explained what in it.

Qbanyto

  • Full Member
  • ***
  • Posts: 137
  • Vista Larga, Paso corto
I got lost in the Gravity Animator portion. what values do i put in the fsm bool test and others? I don't know what fsm name, variable name, etc. also i have the "start" on top of get grounded but how do i get the "jump" rectangle pointing down to "done" on the left there?

What/how do i put it in the "set gravity value" and "set grounded value?
« Last Edit: August 12, 2020, 09:44:40 PM by Qbanyto »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Hi.
For Grounded you need to make an fsm to check if you player is grounded.
You can do this with a trigger under the foot of the player, or use raycasts.
that fsm need to set a bool 'true' if grounded and 'false' of not grounded.

in Set Grounded you can set the Move Y Value to 0 (by using set fsm float)
in Set Gravity you can set the Move Y Value to minus something (for example -5)

For the jump pointing, here is a video on Global Transitions :

« Last Edit: August 13, 2020, 04:06:03 PM by djaydino »

Qbanyto

  • Full Member
  • ***
  • Posts: 137
  • Vista Larga, Paso corto
Ok So I already have controls set in place, so what I did was implement your Tween jump to my Jump FSM and he jumps perfectly HOWEVER, if I'm running and then I jump, he jumps in place instead of jumping forwards. The x/z Value doesn't transition on the jump. so he runs runs runs and jumps straight up.. lol.

How do I carry over the directional value?

Hi.
For Grounded you need to make an fsm to check if you player is grounded.
You can do this with a trigger under the foot of the player, or use raycasts.
that fsm need to set a bool 'true' if grounded and 'false' of not grounded.

in Set Grounded you can set the Move Y Value to 0 (by using set fsm float)
in Set Gravity you can set the Move Y Value to minus something (for example -5)

For the jump pointing, here is a video on Global Transitions :


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
hi can you show your fsms/states/action.

if you use multiple character move actions you will have issues.

Qbanyto

  • Full Member
  • ***
  • Posts: 137
  • Vista Larga, Paso corto
I only have one character controller. see photos. I added my movement actions and also my jump. I'm really happy with it all with the exception that he only jumps straight up. which obviously is fine when standing still but not when moving around. I want the player to jump in the direction I'm moving and manipulate the jump a bit while in the air as well.





upload images no registration







hi can you show your fsms/states/action.

if you use multiple character move actions you will have issues.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Hi.
Why are you using translate?
Also it is totally different from my sample.

On my sample there is 1 fsm that does the move and the other fsms are giving the data to move (xyz)

Qbanyto

  • Full Member
  • ***
  • Posts: 137
  • Vista Larga, Paso corto
Im not using translate it’s unchecked. I should delete it since I’m not using it.
And when I tried your method, my character wouldn’t move at all. So i went back to mine and just added your tween to position for the jump.

Do I have to implement your movement to be able to jump forward?

Would it just be easier if I use a rigid body instead of a character controller?

Hi.
Why are you using translate?
Also it is totally different from my sample.

On my sample there is 1 fsm that does the move and the other fsms are giving the data to move (xyz)
« Last Edit: August 15, 2020, 03:30:21 AM by Qbanyto »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Hi.
How/where are you moving the character?