playMaker

Author Topic: Flip sprites on NPC [SOLVED]  (Read 1556 times)

j-man82

  • Playmaker Newbie
  • *
  • Posts: 10
Flip sprites on NPC [SOLVED]
« on: February 17, 2015, 06:36:10 AM »
Hi,

I'm wondering if it's somehow possible to use an axis event on a NPC?
I want to use it to set the scale to either 1 og -1 to flip a sprite on the NPC.

I can use it fine when it's a character that I'm controlling, by pressing the A and D keys, but I would like the NPC to also be able to flip, when moving either left or right.

I've tried setting it up like this with a Get Position on the NPC -> store X and Z values in floats -> Convert Float To String (Horizontal and Vertical) -> Axis Event -> Set Scale to -1 or Set Scale to 1
...But that unfortunately doesn't seem to be working...

I also would like to know if it's possible to use the Axis Event based on mouse movement (instead of pressing A and D keys) or swiping on a tablet?

Edit: I found the Vector3 Compare action on the forums, which I think might be what I'm looking for, but I'm not exactly sure how to use it?
Thanks for any help I can get!
« Last Edit: February 18, 2015, 04:21:44 PM by j-man82 »
I make custom music for games - see my portfolio here www.jonaskappel.com PM for rates

j-man82

  • Playmaker Newbie
  • *
  • Posts: 10
Re: Flip sprites on NPC [SOLVED]
« Reply #1 on: February 18, 2015, 04:23:07 PM »
I managed to get it working myself, using get position and float compare. Not sure if it's the best way to do it, but it's working!
I make custom music for games - see my portfolio here www.jonaskappel.com PM for rates