playMaker

Author Topic: 2D 8-Way Movement (Translate Action)  (Read 5165 times)

Vallar

  • Junior Playmaker
  • **
  • Posts: 90
2D 8-Way Movement (Translate Action)
« on: December 19, 2015, 08:01:48 AM »
Hello,

I am creating a top down 2D game and I have successfully created the player 4-direction movement using Get Key Down, Get Key Up and Translate actions with WASD no mouse controls.
However, when I try to make it so the player can move diagonally, I can't figure it out.

I have read multiple threads here but it seems I can't get it to work (specially when the Axis Extended Action). I have been away from Playmaker and Unity for a LONG time so I am a bit rusty. Not sure if I am supposed to use Translate or the Axis thing in other threads, which is better and why? Anyone can point to a tutorial with the Axis method if the Translate method doesn't work?


Thanks in advance.

Vallar

  • Junior Playmaker
  • **
  • Posts: 90
Re: 2D 8-Way Movement (Translate Action)
« Reply #1 on: December 21, 2015, 04:55:03 AM »
Just bumping this as I couldn't resolve it yet.

Thanks a lot!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: 2D 8-Way Movement (Translate Action)
« Reply #2 on: December 21, 2015, 06:41:23 AM »
Hi,

 I would concentrate on why you can't get it to work with the Axis Extended Action. Can you elaborate on what doesn't work for you in this case?

 Bye,

 Jean

cel

  • Full Member
  • ***
  • Posts: 132
Re: 2D 8-Way Movement (Translate Action)
« Reply #3 on: December 21, 2015, 07:52:05 AM »
I would have states that catch the key being pressed and setting a variable, let's say w is pressed set var up to 1, d is pressed set var right to 1; then if var up and var right equals one translate x to x=1 and translate y to y+1; you'll need to move on both axis simultaniously... not sure this makes sense to you.

Vallar

  • Junior Playmaker
  • **
  • Posts: 90
Re: 2D 8-Way Movement (Translate Action)
« Reply #4 on: January 03, 2016, 07:22:20 AM »
Cel,

Thanks for the suggestion, I'll give it a try if all else fails.

Jean,

For some reason I didn't get a notification by email that you replied. I am really sorry. I was traveling that is why I didn't check all that time.

I have dabbled with it again and it worked fine. I think I was doing it wrong the whole time. My only problem with 8 way axis extended action is an effect similar to inertia. This happens with diagonal movement.

So let's say I press W + D to move up and right, if I press for 1 second to move and then leave the keys, the player still moves for about 1/2 second then stops.

The way I setup the action is that I added 10 states for all directions, and inside each direction a translate action and beneath it another Axis Event Extended to pass it to the other directions being pressed including "No Direction". However when "Idle" happens it is sent to the 9th state "Idle" and it contains a send event to "Start" which has only the Axis Extended Action.

Is there anyway to stop that inertia thing?

Or is the only way to get away from that "inertia" feel is to do something like what Cel suggested?
Thank you very much.

« Last Edit: January 08, 2016, 01:51:42 AM by Vallar »

Vallar

  • Junior Playmaker
  • **
  • Posts: 90
Re: 2D 8-Way Movement (Translate Action)
« Reply #5 on: January 08, 2016, 01:52:03 AM »
Bump as I still couldn't get the inertia feel resolved. Sorry.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: 2D 8-Way Movement (Translate Action)
« Reply #6 on: January 26, 2016, 07:41:11 AM »
Hi,

 The inertia feels comes likely from the Input settings itself. Have you double checked and made sure that the input you are using are set up properly to not smoothly raise and lower their values as you press keys?

Bye,

 Jean

Vallar

  • Junior Playmaker
  • **
  • Posts: 90
Re: 2D 8-Way Movement (Translate Action)
« Reply #7 on: January 26, 2016, 09:24:25 AM »
Thanks Jean,

I figured it out through another post. It seems it was set to 3 and I didn't know that the number affects the controls in that manner.