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 vampiretears · Mar 19, 2012 at 05:36 AM · timespeed

cannot change Cube Speed Over Time

Simply Iam instantiating cube and giving them translation at a specific direction based on a speed variable , when i want to increase the speed over time in type in the update CubeSpeed += 1*Time.deltaTime; That Suppose to increase the Speed by 1 every 1 Second but it doesn't .. the old Cubes that are instantiated are having the old Speed and the new instantiated one are even though i reduced the num to a very low number like .0001 and it still extremely fast , i tried a function and Invoke Repeat it but it doesn't work and a very strange attitude happened when i removed it again , the cubes are instantiated normally in the beginnig and then the cubes get closer and closer although i didn't change the time at all ,i also tried to make it change based on the time passed so i used the function that are commented below but it didn't work either !!! + my game is endless so how am i suppose to make it endless so how am i suppose to increase it without using invokeRepeating or even the Update? i just want to speed the cube over time why the hell it doesn't work ?? here is the very simple code i used

static var CubeSpeed:float =.5;

private var TimeNow = Time.time;

//private var CurrentSpeed=2;

private var PrevTime=0;

// // // function Update () {

transform.Translate(0,0,-.1*CubeSpeed);

     if(transform.position.y >=10.13507)
 
 {
     Destroy(gameObject);
 
     GameController.Score +=10;
     
 }

// if(TimeNow - PrevTime >=3)

// { // //ChangeCubeSpeed (1);

// PrevTime=TimeNow;

// } // Debug.Log(CubeSpeed); //// // function ChangeCubeSpeed( n:float ) //{ // n= .5; // CubeSpeed+= n; //} // //
//
}

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

1 Reply

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

Answer by hijinxbassist · Mar 20, 2012 at 01:14 AM

1 * Time.deltaTime is the same as just saying Time.deltaTime. The equation you want is Time.deltaTime/1 this will be over the course of one second. the other value you were seeing was delta time by itself, which is super low. Happy trails :)

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 vampiretears · Mar 20, 2012 at 01:44 PM 0
Share

thanks really it did work , That Was Obvious :D my fault, but the cubes are still getting closer when i speed up them by a small value .

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Different swipe speed between iPad2 & iPad3 0 Answers

Time.deltaTime problems? 1 Answer

animation to play faster over time 2 Answers

Game structure: Time intervals, enemy speed, enemy quantity. How best to set this up? 1 Answer

Limited Energy Regeneration 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