Skip to content

hamdanbasri/AutoRotateControl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Auto Rotate Control

Logo

Easy to use Unity's GameObject Auto Rotate Control.

version 0.0.1
August 2022


Table of Contents
  1. About
  2. Functions
  3. Getting Started
  4. Example
  5. Known Issues
  6. Future Ideas
  7. Contact

About

Made with Unity C# Beginner
Too tired of creating a simple rotating animation for a single gameobject?
Realizing that you need to create the same rotating animation for another gameobject?
Me too, that is why I created this simple to use Auto Rotate Control script.

Functions

version 0.0.1

  • Instant rotation of GameObjects.
  • Add as many objects that you want to rotate together.
  • Assign keys to rotate and reset the rotation.
  • Adjust the speed of the rotation.

Getting Started

Visitors

  • Open Unity and add a Cube to the scene.
  • Create an empty GameObject and rename it to AutoRotateControl.
  • Attach the AutoRotateControl.cs script to the AutoRotateControl.
  • Add the Cube or as many GameObjects that you want to rotate together in the same script by adding them to the Object To Rotate list.
  • If you want to rotate the object/objects on key press, simply check the Key Press Enable and select the keys you wish to use.
  • Adjust the speed by moving the Slider.
  • Add Notes on top to keep track of the objects that you AutoRotate.
  • Press Play in your editor and all the objects you had assigned will now rotate according to your settings.

Example

Sample

Simply add the script to any GameObject and set the properties.


Variable Annotation
Notes Add Notes
Start Rotate Key Set the key to press to start the rotation
Reset Rotation Key Set the key to press to reset the rotation
Key Press Enable If enable, rotation will only start on the key pressed assigned to Start Rotate Key
Positive X The GameObject/GameObjects will rotate in the Vector3.right direction
Negative X The GameObject/GameObjects will rotate in the Vector3.left direction
Positive Y The GameObject/GameObjects will rotate in the Vector3.up direction
Negative Y The GameObject/GameObjects will rotate in the Vector3.down direction
Positive Z The GameObject/GameObjects will rotate in the Vector3.back direction
Negative Z The GameObject/GameObjects will rotate in the Vector3.forward direction
Speed Adjust the speed of the rotation
Object To Rotate Arrays of object to be rotated

Known Issue

version 0.0.1 (August 2022)

  • Does not work for VR

Future Ideas

  • Able to add a groups of objects to be rotated. (Allow you to differentiate different group rotation)

Contact

Twitter LinkedIn

(back to top)

About

Rotate any GameObject on individual axis and controlling their speed

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages