playMaker

Author Topic: Send global event on gameObject's rotation angle?  (Read 3644 times)

Groo Gadgets

  • Beta Group
  • Full Member
  • *
  • Posts: 175
Send global event on gameObject's rotation angle?
« on: March 09, 2012, 12:42:57 AM »
Hey everyone,

I'm trying to build a slot machine like reel and i'd like to create an FSM (or action?) that can simply send a global event every 15 degrees of the rotation of an empty object.

I've spent a few days working on it and I have it working reasonably well but the resulting state machine is quite complex, my goal is to simplify it for the sake of efficiency.

I've looked at the "float switch" action and it would do exactly what I want, if only it could compare floats rather than being less than.

Has anyone got a good FM workflow or custom action that could help me out?

Thanks!
« Last Edit: March 09, 2012, 03:06:58 PM by avrigus »

AlanSmithee

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Send global event on gameObject's rotation angle?
« Reply #1 on: March 21, 2012, 04:21:50 AM »
Hey hey,

There was already a thread on this.
see: http://hutonggames.com/playmakerforum/index.php?topic=1150.0

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Send global event on gameObject's rotation angle?
« Reply #2 on: March 21, 2012, 05:46:49 AM »
Hi,

 Sounds lie I really need to get down to it :)

Regards your actual question. Why would you need to fire an event every 15 degrees?

else, try to invert the logic: instead of firing every 15 degrees, know the speed and fire every x milliseconds, that would end up being the same.

else, make a trigger attached to the reel and as it spin pass through the winning line, and fire that. you can make then as many triggers as you want around the reel.

the problem with degrees and angles in general is that it's not very convenient to work with it, because of the looping situation after 360, etc etc.  So I would try another approach personally.



 bye,

 Jean