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 Humb · Jul 20, 2012 at 01:09 PM · rotationslow

Rotate Camera Slowly

Im having a circular game board containing 40 tiles . i have to rotate camera onto every third tile . well performed functionality . but when it moves it gives a jerk cos of waitforseconds used to delay movement. well i used Slerp and used Time. delta Time but it didn't give any suitable result . can anyone suggest how to perform it ?

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 ScroodgeM · Jul 21, 2012 at 06:07 PM 2
Share

show your sources first. fixing mistakes takes a lot less time then writing a scripts from scratch

avatar image Bovine · Jul 23, 2012 at 05:30 PM 1
Share

You probably don't want WaitForSeconds() you probably just need to yield return null;

But as @Scroodge$$anonymous$$ says, please post the relevant bit of code.

avatar image Humb · Jul 24, 2012 at 04:43 AM 0
Share

for(Tile =1;Tile<=60;Tile++) { lGoTargetTile = GameObject.Find( "tile"+Tile+"target"); Floatdistance = Vector3.Distance(lGoTargetTile.transform.position,lobj$$anonymous$$ainCamera.transform.position); if(Floatdistance>.3 && Tile%3==0) { lobj$$anonymous$$ainCamera.transform.rotation = Quaternion.Slerp (lobj$$anonymous$$ainCamera.transform.rotation,lGoTargetTile.transform.rotation,Time.deltaTime); } }

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Ranger-Ori · Jul 24, 2012 at 06:33 AM

First, when you post a script, you should post it in the "Answers", and not in the "Comments" section, since it's a bit hard to read.

I think you should multiply the Time.deltaTime with a variable, and in case you want the rotation even slower, you should set the variable as a decimal number. 0.1/0.5..., 0.01/0.25.., 0.001... and so on until you'll get the suitable rotation.

Comment
Add comment · Show 1 · 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 Humb · Jul 24, 2012 at 07:29 AM 0
Share

thanx for d format . i have tried the fixed values also . it ddnt work .

avatar image
0

Answer by Humb · Jul 24, 2012 at 07:36 AM

   for(Tile =1;Tile<=60;Tile++) 
   {
    lGoTargetTile = GameObject.Find( "tile"+Tile+"target");
     Floatdistance = Vector3.Distance(lGoTargetTile.transform.position,lobjMainCamera.transform.position); 
    if(Floatdistance>.3 && Tile%3==0) 
     {
      lobjMainCamera.transform.rotation = Quaternion.Slerp(lobjMainCamera.transform.rotation,lGoTargetTile.transform.rotation,Time.deltaTime); 
     }
   }
Comment
Add comment · Show 4 · 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 Ranger-Ori · Jul 24, 2012 at 07:55 AM 1
Share

Ahh I get it, the problem is because the computer "Find" all tiles at one framerate speed, and rotates it in the very moment. a for loop executes in the Update function in 1 frame. What you should do, is do these commands outside the for loop. Then add it a factor for speed.

avatar image Humb · Jul 24, 2012 at 08:06 AM 0
Share

im using this code in start function . and yes may be that can be the reason . how could i overcome that or is it same in start too as update .

avatar image Ranger-Ori · Jul 24, 2012 at 08:23 AM 0
Share

Start function only starts once. Awake function starts every time the script is called. Update/LateUpdate/FixedUpdate are functions that are renderered all the time. (in different framerates speed) you should use FixedUpdate, it's better for physics and movement.

avatar image Humb · Jul 24, 2012 at 11:05 AM 0
Share

actually im new to unity and dont know much . so ill hav to check . thanx for d reply

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

7 People are following this question.

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

Related Questions

Rotate a cube using touch 0 Answers

Rotating camera, but it slows down after ~30 degrees? 0 Answers

rotating a bone slows down frame rate considerably 1 Answer

Android screen rotation very slow and my audio keeps going but the graphics stop 0 Answers

Flip over an object (smooth transition) 3 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