Forum rules - please read before posting.

Hotspot toggle click ? Click hotspot to switch on and off animation.

Hi, I'm trying to click a hotspot to start a simple mecanim animation (object spins on spot). This is working fine.
However, i would like to click the same hotspot to switch off/pause the animation. I'm unsure to to make this happen.

A similar set up would be, a simply toggle light switch. Click once for on, click again for off

Basically i want to know how to make a toggle switch using a hotspot, or am i doing this the wrong way?

Thanks for any help
Jason

Comments

  • I'd do that with a bool variable. Create a local bool variable called e.g. "Object spinning" and set its initial value to false. Then when interacting with the hotspot check the value of the variable - if false start animation and set variable to true, and if true stop animation and set variable to false.
  • Wow. Just like that, it works. Thank you so much.

  • You're welcome :smile:

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.