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 Grievemourne · Dec 02, 2012 at 07:22 AM · rotationtimeaxisaccurate

How do I rotate accurately over time while ignoring other axis's?

I have a rotation that I want to happen over time, but can't really use slerp or lerp (as far as I know), because I need to allow for dynamic movement and rotation over that period. I've currently been using function with a regular transform.rotate along with a countdown using a comparison between a float variable and time.deltatime, but it does not grant me the accuracy that I need as when the function is called several times. I just need it to move along the world axis, with which the function works fine short of this problem. I've tried several fixed and unfixed variants to make it more accurate, but It's not working.

Using slerp earlier caused the player to be trapped in limbo, constantly moving toward the target rotation, but not being able to leave it. It's also very inefficient since I just want to rotate it a set amount without restricting the other rotations of the player, which I can't seem to with (s)lerp; I don't know how to get it to ignore the other axis's.

 function Update() {
     if (rotateBackFlip == true){
             if (backFlipTime > 0){
                 targetScript.myPlayer.Rotate(Vector3.right * degreesPerSecond * Time.deltaTime , Space.World);
                 backFlipTime -= Time.deltaTime;
             }
     }
 }
Comment
Add comment · Show 3
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 smnerat · Dec 02, 2012 at 10:03 PM 0
Share

I don't quite understand what you're asking and want to get some clarification before I try and answer. Your trying to get an object to rotate (around a point, or around one of its axis?) over time? And what do you mean by accuracy? Are you talking about the degrees rotated, time to rotate, etc?

avatar image aldonaletto · Dec 02, 2012 at 10:25 PM 0
Share

Getting accurate rotation around some axis and at the same time allow rotation in the other axes doesn't make much sense: the rotations are combined and the result is absolutely unpredictable for any human $$anonymous$$d!

avatar image Grievemourne · Dec 03, 2012 at 04:02 PM 0
Share

I have on object rotated along the world axis - not its own, nor around a point - so that it can move along its local rotations while it's being rotated, and it's working fine in that regard. Deltatime, however, isn't accurate enough to end up being rotated the full 90/180 degrees that it's multiplied with every time, sometimes less, sometimes more. i'm sure if this has something to do with the way the time and numbers are updated, but it's just not accurate enough.

0 Replies

· Add your reply
  • Sort: 

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

12 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

Related Questions

Programming Accurate Clock Hands 1 Answer

Rotating around the Y axis then on Z axis makes my object rotate on the X axis 1 Answer

Spinning a sphere, like a globe. 1 Answer

90 Degree stopping rotation on y-axis issue 0 Answers

LookAt on one axis 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