Rotating an object relative to an axis

Hey everyone!

Sorry to bother you guys with this, but my brain is fried and I could use some help!

I’m working on a project that has a clockface that is angled up at a 45 degree angle and facing about 15 degrees to the left (if facing the object from 0,0,0).

The watch has hands that need to rotate relative to time and I’d prefer to have all hands moving as a real watch would (minute, hour hand slightly increment yaw rotation until the time is reached).

Normally I don’t think this would be an issue (I already have the logic to rotate the hands in a normal scenario working), but the the watch was transformed in the 3D modelling tool and not exported at transform 0,0,0, so trying to rotate the Y axis makes X and Z go all wonky.

I was wondering if there was some UE4 magic (or just some basic trig) that I could use to add the proper X and Z rotation to the hands of the clock so that I can set the rotation of the Y axis relative to 0,0,0 without having to request that the model be resent to me or having to fix it myself as I don’t want to make my client wait too much longer.

Thanks again for all of the help!

you make it sound like when the mesh was exported it had a random rotation. if thats the case then you really should fix its rotation so you have the face along an axis, then you can set the rotation of the actor in ue4. you could also just change the import rotation and reimport so you dont have to take the mesh to a modeling program.

once your clock face is aligned to a axis its easy work to get hand component and set relative rotation. actually you may be able to play with the parenting of the clock and hands to get it to work no matter the rotation, though it may depend on the origin location of the clock.

but yea there should be some ways to accomplish your goal. good luck.

As ThompsonN13 said it’s going to be best to fix the rotation. I’ve tried re-parenting the meshes to anchors to try and get an axis that I can work with, but the import rotation is too random to make any sort of smooth calculations without hacking the current setup apart.

Thank you for the input!