Rotating in World Space- Game Dev Series 141

Quick guide of rotate an object in world space of Unity.

When rotate an object in Unity, we usually use transform.Rotate(). In this quick tip, I would demonstrate how to rotate an object in world space.

Rotating object

In this tutorial, I would make a box of pistol ammo rotating in the air.

To rotate an object, using transform.Rotate() in Update().

Inside transform.Rotate(), we need to assign which axis that we would like to rotate. Then multiply it to deltaTime.

So far, this would be the basic way to rotate an object in Local space.

World space

It would be very simple to rotate in world space. We simply add another parameter.

Add another parameter to it: Space.World.

That should make your object rotate in world space, just like my pistol ammo.

--

--

--

A passionate gamer whose goal is to work in video game development.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Bookmarks are great, but…

Having a control on your version control — Part 1

Ganzer-HD Outside the Wire 2021 Film stream Deutsch — Online Kostenlos

Memory Tuning a High Throughput Microservice

How to create a WordPress blog in the cloud for less than $20 (A beginners guide)

How to Add Your Maverick Mava NFT Minted on Project Galaxy to Metamask Wallet

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
S.J. Jason Liu

S.J. Jason Liu

A passionate gamer whose goal is to work in video game development.

More from Medium

Create A White Noise Shader With Shader Graph In Unity

Adding another powerup — Shields

Learn to code by making 2 D space shooter.

Making a 2.5D Character Controller in Unity Part 2