Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by TurboHermit · Nov 28, 2012 at 09:34 AM · rotationquaternionaxisangleseuler

Rotation like in editor

I've been messing with rotation the last few weeks and I haven't really figured it out yet.

In the editor I just have to edit the X axis rotation to get the effect I want. Is there anyway to rotate your object in script the way you do it in the editor, only over the X axis?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by DeveshPandey · Nov 28, 2012 at 09:40 AM

Write these lines in Update() function and put this script on the object that you want to rotate.

 var speed:float = 50;// as needed 
 transform.Rotate(Time.deltaTime * speed,0 , 0);
Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image fafase · Nov 28, 2012 at 10:27 AM 0
Share

This is about to be real slow :)

avatar image Maulik2208 · Nov 28, 2012 at 10:29 AM 0
Share

But he can manage the Rotation speed as well threw adding a variable in multiplication with time.deltatime....

avatar image DeveshPandey · Nov 28, 2012 at 10:35 AM 0
Share

@fafase : exactly, we can manage speed by as $$anonymous$$aulik2208 says.
var speed:float = 50;// as needed
transform.Rotate(Time.deltaTime * speed,0 , 0);

avatar image fafase · Nov 28, 2012 at 10:35 AM 0
Share

yep obviously, I just meant so because you only have deltaTime there.

avatar image DeveshPandey · Nov 28, 2012 at 10:37 AM 0
Share

ohk thanks :)

avatar image
0

Answer by Maulik2208 · Nov 28, 2012 at 09:59 AM

Means You want the same effect after pressing "E" in editor in unity.....a circle appears and by that Rotate the Object??? or Just Rotate in case of just Rotate Go with the Answer By @DeveshPandey and if you want to define the Rotation speed then just write

`transform.Rotate(RotationSpeed * Time.deltaTime,0 , 0);` //define rotation speed as per your need

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image TurboHermit · Nov 28, 2012 at 10:25 AM 0
Share

I mean in the Inspector, in the transform. If I edit my X rotation there it goes the way I want it to. I'm now using LookRotation quaternions aimed at an object on mouseposition in 2D space, which works fine.

But as I'm trying to Lerp it, it Lerps over all axi ins$$anonymous$$d of only the X.

avatar image fafase · Nov 28, 2012 at 10:28 AM 0
Share

You could have a look at this for how to use quaternions http://unitygems.com/quaternions-rotations-part-1-c/

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

13 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Rotating tank barrel on X axis while the parent Turret rotates on Y axis 2 Answers

How do I rotate a game object in 45 degree steps per keystroke? 2 Answers

90 Degree stopping rotation on y-axis issue 0 Answers

Rotation math question: car movement on a cylinder 0 Answers

Rotate on one axis and check if angle is inside desired range 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges