playMaker

Author Topic: Better Jump 2d Script into an action  (Read 1320 times)

Giliax

  • Playmaker Newbie
  • *
  • Posts: 2
Better Jump 2d Script into an action
« on: September 12, 2020, 04:47:47 PM »
Hey Guys!

I have been making Playmaker Tutorials on youtube for simple stuff. I was requested to make a 2d player controller which was easy to make:
I just don't like the floating feel of the character when jumping and I am recommending people to use a better jump script which has like two lines of code (attached). I believe however that this could be made in a simple action.
I tried to make it but could not figure out fully as on how to make it work due to my limited programming experience. Would be awesome to get some support!

Cheers!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Better Jump 2d Script into an action
« Reply #1 on: September 17, 2020, 07:53:08 AM »
Hi.
There are different ways to approach this (gravity/drag/velocity/force)

But you should handle this in a separate fsm.

You can for example use curved tweens
and manipulate the velocity.

You also could do a upward force and then manipulate drag/velocity over time.

Most important is to do this in a separate fsm so you have full control.

Also have a fsm that checks for grounded.

And use Fsm actions like 'Fsm Bool Test' (Ecosystem)

I also noticed in the video that you used a Set Properties action for the sprite flip,
i believe that there is an action on the Ecosystem for this.

Get/Set properties are using mirroring and are slower than dedicated actions.
Also if you use Get/Set properties, there is a big chance that you need to use Linker Wizard to make it work in a build.

Here is a video about Global Transitions as will need this to send events to other fsm's :)


Giliax

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Better Jump 2d Script into an action
« Reply #2 on: September 18, 2020, 02:19:51 AM »
Thanks for the great hints I will play around with it a bit!