Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

You usually can't apply quaternions directly and it's usually a bad idea to try and do so.

If you want to modify the object's rotation directly best suggestion I have is to modify the eulerAngles. It's much easier to use as it's just a Vector3.

For example something like:

transform.eulerAngles = Quaternion.LookRotation(newRot).eulerAngles;

I haven't tested the above code but I've got something similar running in my game.

Hope this helps

Thank's for the reply.

That's currently doing the exact same thing as the other, i still need to add offsets , does it make it easier to add them with euLerAngles?, i just can't figure out where to put it in there.

eulerAngles is best for setting direct rotations values (It works the same as setting an objects rotation in editer). Other things you could try would be transform.Rotate(x,y,z) for continues rotation or transform.LookAt(targetposition) to point the object towards a location.