playMaker

Author Topic: Simple "patrol" state help  (Read 814 times)

ActionActaeon

  • Playmaker Newbie
  • *
  • Posts: 4
Simple "patrol" state help
« on: July 08, 2019, 07:33:54 PM »
I'm trying to do a simple Goomba-style walk back & forth on platforms, but I'm still very new to Playmaker and I don't have a good handle on the pieces yet. I've got it working with a C# script, but I'm trying to do everything with Playmaker for the sake of learning all the bits. Would appreciate some help!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Simple "patrol" state help
« Reply #1 on: July 09, 2019, 12:08:45 PM »
Hi.
I would have a fsms with 2 raycasts.
1 forward to detect walls (and store bool result)
1 downward (a bit in front) to detect floor.

Then on another fsm use 2x 'Fsm Bool Test' and set every frame (found on Ecosystem)

on same state where you do the movement.

Then when wall is true or floor is false turn image (for example scale to -1)
and move to the other direction.