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
1
Question by jjobby · Sep 17, 2010 at 02:06 AM · physicsmathtimescale

Is this correct to modify real time unit to match with timescale?

I have many simple physics calculation in my script to predict future position, speed or time of the object. The distance shouldn't have any effect from the scale though. For example

distance = speed*time + 1/2*accelerate*time^2
finalSpeed = startSpeed + accelerate*time
finalSpeed^2 = startSpeed^2 + 2*accelerate*distance

If I change the timescale in Unity, how should I change the scale of variables in above equations? The above equations are all real time unit. Is it correct that I have to divide real time unit with timescale? Like this

speed is meter/second so scaleSpeed = speed*timescale
time is second so scaleTime = time/timescale
accelerate is meter/second^2 so scaleAccelrate = accelerate*timescale*timescale

My other question is when I get the value from rigidbody.velocity Is its unit (meter/second) already scaled with timescale or not? And when I use Addforce ForceMode.VelocityChange to change object velocity. If I want to apply velocity = 10 meter/second in real time to the object. Can I use 10 directly or do I need to scale it with timescale before apply it to Addforce?

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

2 Replies

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

Answer by Bampf · Sep 17, 2010 at 11:17 AM

Is it correct that I have to divide real time unit with timescale?

Yes, when you are predicting what the physics will do over time. You can test this by plugging in sample values like 0.5, 1, and 2.

However, in Unity it depends what you do with these numbers. If something is going to happen at Unity Time=3 for example, it will still happen at Time=3 at half speed. It's just that Time=3 won't be seen by you until 6 seconds have elapsed. (Note: Time.realtimeSinceStartup tracks real-world time.)

rigidbody.velocity Is its unit (meter/second) already scaled with timescale or not?

The velocity value should always look the same regardless of timeScale. Think of it this way: the Unity simulation of the physics doesn't change when timeScale changes; you are just changing how quickly the results are played back.

Can I use 10 directly or do I need to scale it with timescale before apply it to Addforce?

Just apply the 10m/s as you were planning to do. The physics inputs don't change; you are just experiencing the final playback slower or quicker.

Comment
Add comment · 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
0

Answer by Arnie john · Jan 25, 2011 at 06:49 PM

why we should use second unit in our graph?? not minute,hour or etc...especially for realtime

Comment
Add comment · 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

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

No one has followed this question yet.

Related Questions

calculate time required if timescale is changed 0 Answers

How to make any dice have a given face(int) face up? 1 Answer

How to calculate desire angular velocity? 1 Answer

What is drag and velocity measured in? 3 Answers

My character moves in seemingly random directions. 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