playMaker

Author Topic: Play audio on mouselook?  (Read 999 times)

twerkface

  • Playmaker Newbie
  • *
  • Posts: 8
Play audio on mouselook?
« on: February 19, 2016, 02:33:47 PM »
Hi everyone,

My current project involves a couple 3D models that rotate on mouselook. I would love to be able to play an audio file on each object when the user moves the mouse, and have it stop once the user has let go (sort of like scratching a vinyl record, as if the object is scraping against something and producing the sound), but am not sure how to achieve this. I've tried two methods:

- Using Float Changed to detect if a rotation variable has changed, as a cue to Audio Play. <- The audio immediately starts playing, presumably because a change in rotation is being detected at runtime?

- Using Axis Event to transition to Audio Play when Any Direction is received (and transition back when there is No Direction). <- This almost works the way I wanted, but unfortunately the state seems very sensitive in picking up No Direction, even when I am constantly moving the mouse, thus producing a somewhat erratic audio start/stop. Perhaps there's a way to mitigate this?

Would really appreciate any tips, and I'm sure I am missing a much simpler solution...!