playMaker

Author Topic: making dash in 2d  (Read 1645 times)

ffffffffff

  • Playmaker Newbie
  • *
  • Posts: 18
    • View Profile
making dash in 2d
« on: April 20, 2020, 07:33:11 AM »
so i use playmaker to make a dash thing turn out fine until  the player can dash through wall   pls i need help i use translate

heavygunner

  • Sr. Member
  • ****
  • Posts: 340
    • View Profile
Re: making dash in 2d
« Reply #1 on: April 20, 2020, 11:31:57 AM »
Did you added colliders?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6398
    • View Profile
    • jinxtergames
Re: making dash in 2d
« Reply #2 on: April 21, 2020, 03:51:17 AM »
Hi.
Translate does not use physics.

Use set velocity (and have a rigidbody2d) or use raycasts and stop translation.
But with fast moving raycast might fail.
Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!

ffffffffff

  • Playmaker Newbie
  • *
  • Posts: 18
    • View Profile
Re: making dash in 2d
« Reply #3 on: April 22, 2020, 12:08:58 AM »
i do like you said it work a bit but the player can only dash in 1 direction so how do i make the player to dash left and right

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6398
    • View Profile
    • jinxtergames
Re: making dash in 2d
« Reply #4 on: April 22, 2020, 05:32:51 AM »
Hi.
you can set a negative velocity as well

so 1st detect what direction the player is (depending on how you do this, scale/sprite flip/rotate)

then for the negative value you can set manual OR do a float operator and multiply by -1
Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!

ffffffffff

  • Playmaker Newbie
  • *
  • Posts: 18
    • View Profile
Re: making dash in 2d
« Reply #5 on: April 22, 2020, 11:59:20 AM »
so which action should i use to  detect the player movement

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6398
    • View Profile
    • jinxtergames
Re: making dash in 2d
« Reply #6 on: April 23, 2020, 07:34:48 AM »
Hi
how are you moving the player?
and how are you flipping the player?

For example if you use scale, then get the x scale and check if greater or less than 0.
if you use rotation get the rotation and compare if 0 or not
if you use sprite flip then get that value and check the bool.
Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!

ffffffffff

  • Playmaker Newbie
  • *
  • Posts: 18
    • View Profile
Re: making dash in 2d
« Reply #7 on: April 26, 2020, 12:52:38 AM »
I use scale but the point is i don't know which action to check .like set up a bool or add force,etc

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6398
    • View Profile
    • jinxtergames
Re: making dash in 2d
« Reply #8 on: April 26, 2020, 09:23:04 AM »
Hi.
Get Scale, Then Float compare

if less than 0 do force left/right
if greater than 0 do force in the other direction
Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!

ffffffffff

  • Playmaker Newbie
  • *
  • Posts: 18
    • View Profile
Re: making dash in 2d
« Reply #9 on: May 01, 2020, 10:13:15 PM »
could you make an  example for me. i dont know how to use get scale

ffffffffff

  • Playmaker Newbie
  • *
  • Posts: 18
    • View Profile
Re: making dash in 2d
« Reply #10 on: May 02, 2020, 05:27:55 AM »
so this is my FSM it dont work . am i miss order them. pls help

ffffffffff

  • Playmaker Newbie
  • *
  • Posts: 18
    • View Profile
Re: making dash in 2d (Solved )
« Reply #11 on: May 02, 2020, 10:18:11 AM »
thank a lot .

ffffffffff

  • Playmaker Newbie
  • *
  • Posts: 18
    • View Profile
Re: making dash in 2d
« Reply #12 on: May 02, 2020, 11:44:03 AM »
So far i made the dash work . But i can only dash in mid air .i want to dash while on the ground as well . What should I do.Again thank for helping me