playMaker

Author Topic: Dashing Player Help [2D Game]  (Read 3143 times)

sapigwetao

  • Playmaker Newbie
  • *
  • Posts: 21
Dashing Player Help [2D Game]
« on: June 15, 2020, 12:59:48 PM »
Hello guys, im trying to add a dash to my characters, and when i try to addForce2D on X, nothing happen. i wondered when Y axis is working but X axis not working at all, i try to zeroing friction on the ground, nothing happen. and so do in the middle of air.

when i try to use velocity, nothing happen either. but using Translate is working, but make he blinking / teleport and not that i want.

anyone can help with me with this case?

thank you

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Dashing Player Help [2D Game]
« Reply #1 on: June 15, 2020, 02:59:12 PM »
Hi.
If you are moving with velocity you need to disable that when doing the dash (preferably dash with velocity and you can use a tween with a curve to manipulate the dash)

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: Dashing Player Help [2D Game]
« Reply #2 on: June 15, 2020, 03:02:10 PM »
Lots of people have problems with such things, and it’s almost always set velocity. Check if set velocity is active somewhere, probably overriding the force you try to add.

sapigwetao

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Dashing Player Help [2D Game]
« Reply #3 on: June 16, 2020, 02:57:06 PM »
Lots of people have problems with such things, and it’s almost always set velocity. Check if set velocity is active somewhere, probably overriding the force you try to add.

how can i overriding that? anyway when i want to make dash, do i need a new FSM, or just put inside my Movement FSM?

[/quote]
Hi.
If you are moving with velocity you need to disable that when doing the dash (preferably dash with velocity and you can use a tween with a curve to manipulate the dash)

thanks for your reply. how can i disable with the velocity first?
im new on Playmaker, any tutorial? tween? you mean itween or what?
i never use itween

Thank you
« Last Edit: June 16, 2020, 03:00:05 PM by sapigwetao »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Dashing Player Help [2D Game]
« Reply #4 on: June 16, 2020, 06:40:41 PM »
Hi.
How are you doing movement (maybe show image :) )

iTween is obsolete, you can use the tween beta :
https://hutonggames.fogbugz.com/f/page?W1714

But try first to get it to work without this :)

You might want to do it separate but it depends on our setup.

On the movement fsm you can add a empty state and set a global transition (call it Player/Movement/Disable for example)

Also set a Global Transition to enable again (call it Player/Movement/Enable for example)

using "/" will help finding events and variables (it works like subfolders)

Here is a video on transitions :


sapigwetao

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Dashing Player Help [2D Game]
« Reply #5 on: June 19, 2020, 07:08:09 AM »
Hi.
How are you doing movement (maybe show image :) )

iTween is obsolete, you can use the tween beta :
https://hutonggames.fogbugz.com/f/page?W1714

But try first to get it to work without this :)

You might want to do it separate but it depends on our setup.

On the movement fsm you can add a empty state and set a global transition (call it Player/Movement/Disable for example)

Also set a Global Transition to enable again (call it Player/Movement/Enable for example)

using "/" will help finding events and variables (it works like subfolders)

Here is a video on transitions :


Hello sorry for late reply,
i havent try the tween because im trying to make 2d asset right now, and here is my movement.

https://ibb.co/dMW6XG4

im just following the tutorial for the movement FSM, and i also add another FSM for flip if velocity -1 then flip left vice versa (does it have anything with the dash movement?)

and are using tween is more comfortable and easier than using velocity etc?

that is it, thank you very much.

sapigwetao

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Dashing Player Help [2D Game]
« Reply #6 on: June 19, 2020, 09:18:32 AM »
Damn its working in my movement FSM i add a Dash state (using float compare if velocity -1 then dash left, if +1 then dash right) with using AddForce 2D.

it is okay with that? because i didnt know how to do it right, im just using my logic. lol

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Dashing Player Help [2D Game]
« Reply #7 on: June 19, 2020, 10:14:56 AM »
Hi.
i usually look to the facing direction
For example the Y rotation, scale or flip (on the sprite renderer)
also i tend to use velocity instead of Force.

Actually in our game 'Dark Light' i use both.
I have a small force upwards on the start and forward is done with velocity (with a float tween handling the velocity)

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: Dashing Player Help [2D Game]
« Reply #8 on: June 19, 2020, 02:09:16 PM »
I first used set velocity, but that caused too many problems for what I tried to do. I now never set velocity, but use add force and clamp at max speed. After a long time, I also switched to scripts for core mechanics (no playmaker) as it was approaching a level of complexity where I didn’t gain anything with it, and playmaker was not responsive enough for that task. It may not slow down the game per se, but in my tests, it isn’t fast enough for responsive controls. However, I use it for many other things and it’s still excellent to quickly whip up a mechanic to test.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Dashing Player Help [2D Game]
« Reply #9 on: June 20, 2020, 08:28:54 AM »
Hi.
I had actually the opposite force was giving me a lot of issues.

Quote
playmaker was not responsive enough for that task
I have not have any responsive issues yet with using Playmaker.

Jean actually did a test and rebuild the ufo 2d sample with playmaker, and had actually better performance than the scripted version.

for certain complexities it might be easier to do in scripts.

Can you give an example on the responsive issues you had?

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: Dashing Player Help [2D Game]
« Reply #10 on: June 20, 2020, 02:14:57 PM »
...

Jean actually did a test and rebuild the ufo 2d sample with playmaker, and had actually better performance than the scripted version.

for certain complexities it might be easier to do in scripts.

Can you give an example on the responsive issues you had?

There was a certain delay between input and action. Not much, but not fast enough for my tastes. That particular prototype was just made with square sprites, tilemap, and a square for the character, but a dozen of FSMs, neatly doing each their task, flipping, jumping, walljump, falling through semi-solid platforms etcetera. It was also becoming difficult to manage, even with extra care, and missing new input system then gave the KO (didn’t want to set up that many inputs with the old system). I thought it was maybe because of an older notebook, but I tested my new setup on it, too, and it works fine.

Anyhow, with many good and even great character controller scripts out there, I would recommend maybe not building that with FSMs, unless as a learning exercise. Also Unity’s examples typically play terribly. The UFO thing didn’t play that well, and the new Lost Crypt plays quite badly — but I understand they want to show how to set this up, shaders, render pipeline etc.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Dashing Player Help [2D Game]
« Reply #11 on: June 20, 2020, 05:21:56 PM »
Hi.
i'm using rewired, but never noticed any delay.

and our character movement is quite complex