• 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
2
Question by Greg 8 · Dec 31, 2010 at 05:44 AM · physics

Predicting rigid body location in the future

Is there a way to "fast forward" the physics simulation to a predetermined amount of ticks?

What I'm looking for is the effect usually found in computer pool/billiard games where the game can predict the ball location and plot its path in the future before the shot was made.

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

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Justin Warner · Dec 31, 2010 at 05:50 AM

Maybe something where you save the time, then you play it, so you see how long (Pause after seconds), then reset the time to before... If that makes sense...

Look up pause menu's and stuff, they use this to do it...

Interesting question though =).

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 poncho · Dec 31, 2010 at 04:22 PM

sadly i have the same problem, but the way that can be done, is that with your physics knowledge anticipate it yourself i made it for a parabolic example, like a cannon shooting at a certain angle in your case of the pool game is easier, you need to just define the moving and then add the new position, like if you are on the position (0,0,0) and your velocity is (2,1,0), after a second your position will be (2,1,0), the next second it will be (4,2,0), the third second will be (6,3,0), etc...

i think that you need this is for makin a lineRender to show where is going to hit

________________________
|    / \                |
|   /   \      /        |
|  o     \    /         |
|         \  /          |
|__________\/___________|

being the "o" the ball and the / the lines of your trayectory

with that line you can have a value of x, y or x and z (depends of your workin axis) and making your vector of velocity with this values and then using the physics to make your trayectory

on google are lots of physics formulas, but this is the main idea of what you need to do

hope you dont have to do it parabolic cuz the unity physics are very realistic and make it very hard to calculate it with the gravity, air drag, drag, etc..

hope this answer helps you =)

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 Loius · Dec 31, 2010 at 05:15 PM

No. Unity's physics aren't predictable enough for something like a pool game or a golf swing - you can predict the general direction but you can't get an exact measure (according to the five or so other questions exactly like this one). If you need precision you'll need to roll your own game-specific physics. Not too horribly difficult with pool since everything is representable by simple shapes.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

2D 360 degress platformer example needed 0 Answers

Rigidbody2D.velocity affects the y-axis, but not the x-axis. 1 Answer

Can I make physics engine speed dependent on frame rate? 2 Answers

Clamp Bike Rotation 0 Answers

Rigidbodies get huge amount of velocity when clipping into other Rigidbodies 2 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