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

Maximum Subarray Product Performance: Divide and Conquer vs Kadane’s Algorithm

Yearn Governance Roundup #3

Talking about ‘not so’ Restful Routes

Realtime user tracking in Spring Boot

Salesforce — Twitter Integration — from scratch using Python, Heroku and Apex.

CS373 Fall 2019 Week 9: Kyle Knight

Setting up Google Colab for DeepLearning experiments

Unlimited Refresh in Power BI!!

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

HitBox Attack System in Unity

Adding Game Over UI elements

Day 103: Creating A Ledge Grab in Unity Part 1

Building a Custom Cinemachine Virtual Camera Zoom Feature with One Button in Unity