playMaker

Author Topic: Why does Set 2D velocity not work?  (Read 1523 times)

Orelya

  • Playmaker Newbie
  • *
  • Posts: 4
Why does Set 2D velocity not work?
« on: March 02, 2020, 07:20:53 AM »
Hey guys!

Total beginner here, playing around with Playmaker to get something to work. Looking at different tutorials, having fun You know how it goes.

Today I followed a simply tutorial to get a gameobject to move on the X axis and to jump on the Y. The teacher used Set 2D velocity to move the gameobject on the Y smoothly - but for whatever reason, I can only get Set Force to work for any kind of movement. I've played around with the 2D Rigidbody settings, different amounts of force and velocity and am really stumped. Velocity only work when checked every frame.

Anyone have any idea what's going on here?

My setup:

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Why does Set 2D velocity not work?
« Reply #1 on: March 02, 2020, 09:43:38 AM »
Hi.
velocity is set 1 frame and after that it gets pushed back down by gravity.

You can use a 'add force' (set force mode to 'Impulse') or make a separate fsm that could handle the jump (more advanced but can tweak more)

for example have a state with set velocity and turn on every frame, then have a wait (for example 0.3 sec)
you could also for example add a button up and set wait a bit longer, then player could jump shorter when button released before wait is finished

Orelya

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Why does Set 2D velocity not work?
« Reply #2 on: March 04, 2020, 08:59:48 AM »
Hey!
Thanks for your reply, it was a great help. Will fiddle around now with these new states.