playMaker

Author Topic: Top Down 2D Movement  (Read 733 times)

baz

  • Playmaker Newbie
  • *
  • Posts: 4
    • View Profile
Top Down 2D Movement
« on: September 18, 2019, 04:01:18 PM »
Hello, I'm new to playmaker and have been mass watching movement tutorials. However the only tutorials I can seem to find on playmaker is for 3d or 2d platformer style movements. So I tried my best to search for answers and come up with my own but I'm stuck on what I'm doing wrong.


You can see I am able to move with how I have it setup. But it doesn't save the position, it resets to 0,0 after I'm done pressing the direction.

Why is this happening? Also is there a specific tutorial on top down 2d movements?

I've scripted movements before, and I found a really good one, but I'm not sure if scripting movements and then doing everything with FSM is a good idea or not? Sorry I'm so new to all this xD

Athin

  • Full Member
  • ***
  • Posts: 148
    • View Profile
Re: Top Down 2D Movement
« Reply #1 on: September 18, 2019, 09:17:33 PM »
Heya,

I can't quite make out the actions you have going in the video due to my internet quality here but I think I know whats happening.

It looks like you got it set to save location every frame?  What you need to do is only record the position while you have a movement key down.  So have an action that listens for movement keys.  While it is press down, do and record the movement position while also listening for that key to be let go.  Once they let the key go have it flow back to the original state listening for it to be press again.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 5795
    • View Profile
    • jinxtergames
Re: Top Down 2D Movement
« Reply #2 on: September 19, 2019, 10:19:20 AM »
Hi.
I can see that player has a Rect transform instead of a standard Transform

any reason why you use that?

for Rect transform i think you should use "Rect Transform Set Local Position"
or another Rect transform action.

Not 'Set Position'

baz

  • Playmaker Newbie
  • *
  • Posts: 4
    • View Profile
Re: Top Down 2D Movement
« Reply #3 on: September 19, 2019, 10:28:00 AM »
interesting so when i made the sprite image a default square image from unity it must have changed it to that automatically. I didnt even know there was a base transform, lol. Let me try without

baz

  • Playmaker Newbie
  • *
  • Posts: 4
    • View Profile
Re: Top Down 2D Movement
« Reply #4 on: September 19, 2019, 07:01:47 PM »
So i was able to get the movement to work, but how do you go about with 8 directional? so far can only do 4 directions

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 5795
    • View Profile
    • jinxtergames
Re: Top Down 2D Movement
« Reply #5 on: September 20, 2019, 11:00:15 AM »
Hi.
When you press up and left, does it not go to the up/left direction?

if not, or if that's not what you mean.
Can you show your setup?