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 /
avatar image
1
Question by oxium · Jun 02, 2011 at 08:50 AM · physicstrajectory

how to predict physics trajectory of a sphere

Hey guys

I'm working on a game where I have to throw a bouncing ball on walls. I have some sort of aiming assistance where I simply draw line from the current ball position to the raycast hit position Then using the raycast hit normal, I compute the reflection vector and display another line starting from the hit position and following the reflection vector direction.. Anyway I'm sure you got my point.. This works perfectly, the raycast always returns me correct Hit point & Reflection vector

But on the physics side the ball doesn't follow the same trajectory at all.. I've tried to turn off the gravity.. same issue I've also tried to use a point (instead of a sphere) by using a tiny radius on my sphere collider.. same issue..

Even with a simple case where I throw the ball in the up direction, with a wall at a 45 degrees angle The ball doesn't bounce on a 135 degrees angle like the raycast does but something around 150..

Am I missing something obvious here ??

Thanks a lot for any kind of answers.. I'm really stuck here and don't write to write my own physics engine ;-)

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
0

Answer by Meltdown · Jun 02, 2011 at 09:41 AM

It sounds like you're headed in the right direction you'll just need to tweak the physics settings of your ball to match your raycasting.

For instance you might want to minimise drag and angular drag on the ball, and play with the mass etc.

I hope that helps either that or I'm totally missing what you are trying to do :p

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 Techsuport · Aug 19, 2011 at 03:48 AM

if u want things to bounce nicely you should move them through script, just use the same ray trajectory to moveyour ball across. I did a project like this after seeing the disc battles in tron ;)

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 oxium · Aug 22, 2011 at 01:52 AM 0
Share

yeah thanks but I dont really want to write my own physics script (it's only moving/bouncing objects.. I still need nice gravity behavior and wind/force effect etc..

anyway as suggested by $$anonymous$$eltdown, all you have to do is make sure you use perfect bounce with no friction on your physics material

basically tuning the materials fixed it but I still can't really predict the gravity/wind behavior perfectly

so I've removed the trajectory from my game :(

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

Ellipticall Orbit like Spaceflight simulator 1 Answer

How to calculate the angle of a trajectory to hit the target 1 Answer

How do I arc a rigidbody so it lands on a target? 2 Answers

Help with calculating 'Grenade' projectile trajectories 2 Answers

2D 360 degress platformer example needed 0 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