playMaker

Author Topic: Event at Rotation Z value[SOLVED]  (Read 1941 times)

hrrsn

  • Playmaker Newbie
  • *
  • Posts: 4
Event at Rotation Z value[SOLVED]
« on: May 01, 2013, 11:46:40 AM »
Basically, I'm an idiot. A few months ago if I'd tried this I could probably figure it out by now, but it's got me stumped. I spent far too long not using Playmaker and now it's defeated me.

Basically what I'm trying to do is rotate an object to a certain point, then stop it and fire an event. So for example's sake, The object starts at 270º, holding a key rotates it, but when it gets to what would be 1350º I'd like to stop it dead.

I figured I could probably use a trigger and a counter to say "You've hit the trigger 5 times, fire TargetHit event".

Any clues or suggestions? Thanks  :)
« Last Edit: May 11, 2013, 10:25:27 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Event at Rotation Z value
« Reply #1 on: May 02, 2013, 03:24:04 PM »
Hi,

 rotate using the "rotate" action not using the "per seconds" and on the same state add the rotation value to a fsm float, use that fsm float to check where you are at and keep track of the total rotation value. Use the "float compare" to trigger events based on certain values.

 does that make sense? Basically, ignore the actually rotation itself, and rely on the incrementation instead.

bye,

 Jean

hrrsn

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Event at Rotation Z value
« Reply #2 on: May 11, 2013, 04:07:25 AM »
You're a genius. Float Compare is fantastic, don't know how I missed it. Had my rotations as floats already so that was super easy to get working. Thanks so much! :D