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 haroonalam · Oct 11, 2011 at 01:27 PM · unityiphone

How to translate object slow in one update call ?

Hello ppl, Here is my code:

 void Update () {
   
 if(!translated)
     {
 
 for(int x=1; x<Map.numColumns; x++) {        
 Tile_Pos = (float)Math.Round(Map.Tile[0,x][0] - transform.position.x,2);
 
 Debug.Log(Time.deltaTime);
 
         
     if( Tile_Pos < 1.55f || Tile_Pos == 1.55f ) {
         transform.Translate( 1.55f, 0, 0);
         translated = true;
         }
         }
     
     }

I have made a grid and now I am trying to move my object grid wise for eg in loop1 it is on first grid, then on loop2 it is on second grid and so on..I am taking the distance between grid and object position and translating it answer times towards x axis, but the problem is object is moving very fast. As I am doing this in one for loop within one update method. How can I move it little slow. ??

Comment
Add comment · Show 2
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 syclamoth · Oct 11, 2011 at 01:56 PM 0
Share

The Update method gets called exactly once per frame- if you want things to happen over multiple frames (i.e, in more than about a 60th of a second), you need to model behaviour over several Updates! Which is to say, you can't have 'slow' movement within a single update loop.

Could you please explain more clearly what you are trying to do here? Do you want objects to slowly move towards target positions, or do you want objects to go to exact locations instantaneously? Without any context it is difficult to help with this kind of problem.

avatar image haroonalam · Oct 14, 2011 at 09:22 AM 0
Share

thnx ppl, I have changed my code and now it translates on every update call,

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

Fade in Fade out in unity 1 Answer

Unity iPhone app size is too big 1 Answer

How can i display a pdf file in a unity scene ? 2 Answers

How to send UIImage data to Unity3d via a C# script and iOS plug-in? 1 Answer


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