Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
This question was closed Dec 29, 2017 at 11:07 PM by noodlesdev for the following reason:

Other

avatar image
0
Question by noodlesdev · Sep 23, 2016 at 10:00 PM · c#deltatime

Value * deltatime / deltatime ?

Is this going to make the purpose of deltatime work ? Instead of increasing the value just multiply and divide.

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

  • Sort: 
avatar image
1

Answer by Bunny83 · Sep 23, 2016 at 10:52 PM

Huh? That would be pointless. IF you multiply and divide by the same number it's like you did nothing.

 "deltaTime / deltaTime" == 1.0

If that was your whole question we're done here ^^. You haven't said what this all is about.

Comment
Add comment · Show 3 · 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 noodlesdev · Sep 23, 2016 at 10:59 PM 0
Share

Yes but you use deltatime, so on every computer it runs on the same speed. Let's say deltatime is 0.01 and your value is 100.

if you do 100 0.01 you'll get 1 but if you do 1 0.01 / 0.01 you also get 1.

Sorry if it's not clear but I had some speed values but when I multiply by deltatime the speed becomes slower and I don't want to find the value to get up to the speed again, so I'm asking if you get the same value of speed again if you divide it by deltatime again.

avatar image Bunny83 noodlesdev · Sep 23, 2016 at 11:41 PM 0
Share

No, if you divide by deltaTime again you just revert the effect of deltaTime. As i said it's like you did nothing at all.

The point of using deltaTime is that you basically change the "unit" of a value. deltaTime must only be used when you add a value every frame.

If you do this:

 float val = 0f;
 
 void Update()
 {
     val += 100f;
 }

You will always add 100 each frame. So when running at 100 fps "val" will be 10000 after 1 second since you get 100 frames in that one second and each frame adds 100.

If it's running on just 20 fps val will only accumulate to 2000 ( 20 * 100).

Without deltaTime the value you add has the unit "amount per frame". When multiplying the value by deltaTime before you add it, the value willhas the unit "amount per second". A second is of course a longer time than a single frame.

If you want "val" to grow by 10000 each second you have to simply use 10000 multiplied by deltaTime. This will add 100 each frame if the framerate is 100 but will add 500 each frame if the frame rate is only 20 frames per second.

 void Update()
 {
     val += 10000f * Time.deltaTime;
 }

You talked about a speed value. We usually measure speed in "distance per time unit" where distance is usually meter and as time unit we usually use "second" (at least in the metric system ^^). So when you deal with speed values that are based on second you simply multiply be deltaTime and get the right result.

avatar image noodlesdev Bunny83 · Sep 23, 2016 at 11:44 PM 0
Share

Ahh thanks!

Follow this Question

Answers Answers and Comments

221 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Animation won't play.. Issue with deltaTime..I think? 0 Answers

Time.deltaTime making color lerp appear fast, but won't reach 1 1 Answer

Making a bubble level (not a game but work tool) 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