# Controlled Rotation of an Object

Ok, experts, here's the challange:

I would like to rotate an object by a specific number of degrees based on user interaction. If I could completely customize a "dial" that might work, but I don't believe that level of customization is available.

Imagine that the user needs to turn a compass rose any number of degrees. I don't think the brute force method of 360 layers or states will do it. Is there a more elegant solution?

###### 22 Replies

You can convert any image to a dial and then set to 360

Hey there, Phil. Really? I clearly need to look at dials more closely. Funny, as I was awaiting a reply I thought you would be the guy to know! Thanks. - Russ

To do that, do I create the object then convert it to dial? Or do I create a dial, then customize its appearance to that of my object?

Hi Russ, select the image and then convert to dial from the insert dial menu. If it is more than one shape i think you can group and convert to a dial

As an added bonus, you can set a trigger to fire when dial changes to set dial = to 0 if dial is equal to 360. This lets you turn it perpetually.

OWEN HOLT

As an added bonus, you can set a trigger to fire when dial changes to set dial = to 0 if dial is equal to 360. This lets you turn it perpetually.

Wow, pro tip! Hopefully I'll remember this one if/when I ever need it (:

Oh, yeah! Nice tip. Thanks. I'm currently fighting it because I want it to rotate 360° in both directions, but always show the proper numerical value. I'm toying with defining it as 720° so that it can rotate both directions, but that is messing with my step values. I'll get it!

Hmmm... Seems to increment through the degrees if the user rotates the object slowly, but a faster movement drops increments.

For example, rotate it slowly 90° to the right and all is well. Do the same rotation quickly and it shows a number much less than 90. The trigger which updates the variable doesn't seem able to keep up with increments quickly enough.

A way around this is to use some other action to rotate the dial rather than having the user turn it directly.
(See what I mean here: Link)

Yep, I  understand and thanks. That would probably be a little kludgey in my application. I did change the trigger from "dial moves" to "variable changes" and expected that would do it, but so far, no good.

I assume this is a known limitation with the dial objects and triggers.

I think I figured a workaround. The dial variable has no trouble keeping up. I was trying to keep a separate degrees variable and that's the one that couldn't keep up. I'll bet if I wait until the user releases the object, THEN do the math, it should work perfectly.

Nope, that won't work. There isn't a trigger that executes on mouse_up. I tried using "object loses focus" but that didn't work either.

Hello Owen. Your example is exactly what I'm trying to do! Would you mind sharing with me how you did that?

Basically, you click a button and it triggers an off-screen object traveling on a repeating motion path. Each time the motion path completes, the dial increment increases/decreases until a whole number is reached. The dial itself also has a motion path on it that remain constant/anchored (i.e. always up). When you click a button to move forward, the dial's motion path is triggered and the dial "slides" down. When the motion path completes, you actually jump to another slide that is a duplicate of the first with one important difference: the spin anchor point for the dial is relocated to be the center of the "piece" now in focus.

It's a bit more complicated than this as you need a bunch of variables to keep track of what piece you are on, which direction the board is facing, and which pieces you can actually move to. I used an excel spreadsheet to design and determine what I would need to track and what variable changes would need to be made with each movement.

Now, with all of that said, the sad news is that Articulate broke this with an update and they haven't quite figured out how to fix it.... yet.
https://community.articulate.com/discussions/articulate-storyline/relative-start-on-motion-path-not-so-relative-after-all

Thanks for responding. Too bad :(

It would have been really useful if Articulate would give us more than just quarter, half, and full turns in the Spin animation. Even adding one-eighth turns would be better than nothing. And if they'd allow us to specify the number of degrees in the animation, that would be enormously helpful.

Very nice! I have looked at a few of your animation examples and am definitely going to give GSAP a try.

If at any point you need help with GSAP specifics... shout out :-)

GSAP might solve my Dial Rotation/Dial on a motion path issues that were introduced as a bug by one of the SL builds. I'll reach out to you Math when I have a work break.... maybe in 2022? 😂

Will do and thank you.