playMaker

Author Topic: Player walk continuously  (Read 880 times)

gusval85

  • Playmaker Newbie
  • *
  • Posts: 1
Player walk continuously
« on: July 12, 2019, 02:00:37 AM »
Hi Everyone, I’m new to the playmaker software and learning visual scripting.

Im trying to make my player walk continuously but I don’t know the script to make it so. I figured how to make my player walk however I have to be pushing the top, down, right, left buttons.

What I’m trying to do is when you hit the play scene I’m trying my make my player walk automatically and just be pushing the right, left buttons to turn. I hope someone can help me out with this. Thank you.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Player walk continuously
« Reply #1 on: July 12, 2019, 03:29:00 AM »
Hi and welcome!

 It really depends your context. Is it 2d, 3d, using physics or not?

Bye

 Jean

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: Player walk continuously
« Reply #2 on: July 12, 2019, 03:29:15 AM »
There’s a (free) addon called Ecosystem, which can you install and which gives you access to tons of additional actions and examples. Check for movement or direction actions. I recall there are 8 directional actions and suchlike.

Assuming physics. The conventional method would simply be to set velocity (every frame) upon entering the state, and checking the input if player goes into a different direction, with float compare. You can probably make it super condensed, write axis into a variable and set this on enter, but an easier and good enough beginner setup simply has one state per direction, and the Set Velocity fixed. E.g. x = -5 on walk left state, x = 5 on walk right state. Next improvement could be to put the input axis actions into a separate FSM, and write the two floats with Set FSM float into the movement one (where they are being compared to determine in which directional state it should be).
« Last Edit: July 12, 2019, 03:31:08 AM by Thore »