- Home /

# Rotation Around Tilted Y-Axis

I have an object that is tilted back 15 degrees. I want to be able to rotate it X degrees around the tilted Y-axis with a LERP, like so:

```
transform.localRotation = Quaternion.Lerp(transform.localRotation, TARGET_ROTATION, Time.fixedDeltaTime * 0.75f);
```

This works for an object is not tilted but, with my tilted object, it obviously, doesn't. My problem is getting the proper TARGET_ROTATION quaternion.

I have beat my head against the wall on this for hours. I would appreciate any help. -- Paul

**Answer** by FortisVenaliter
·
Jan 31, 2017 at 08:50 PM

Well, Lerp wouldn't generally work too well for something like this. I'd probably go with a simpler solution:

```
float rotAroundAxis;
Quaternion axisTilt;
transform.localRotation = Quaternion.Euler(0, rotAroundAxis, 0) * axisTilt;
```

Then you set up the axisTilt variable to be the rotation quaternion of just the tilt in Start(), and update the rotAroundAxis variable each frame.

Fortis, I tried your solution yesterday and it didn't work. I tried it today and it did. Don't ask me what I was doing wrong but, in any case, thanks for the response and the help. Your help was invaluable to keeping my sanity, such as it is ;)

Paul

@FortisVenaliter I tried this solution, perhaps I made an error, but my object just "precesses" instead of rotating about a tilted axis. I'm trying to make a planet that spins around its tilted axis. Here's the coding:

```
public float RotationTilt;
private Quaternion Tilt;
Tilt = Quaternion.Euler(0, 0, RotationTilt);
gameObject.transform.localRotation = Quaternion.Euler(0, B, 0) * Tilt;
//B is rotation angle that's updated every frame.
```

Thanks guys.

Hey guys, turns out I figured out my mistake. I just multiplied "Tilt" before Quaternion.Euler(0,B,0) instead of after it. I guess quaternion multiplication isn't commutative. Never thought about that.

### Your answer

### Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.