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 SergeantBiscuits · Apr 10, 2013 at 06:15 AM · physicsraycastraycastingraylimit

Upper limits of Raycasting; Physics engine "gives up"

Hey guys, I've encountered a strange bug...

I'm making a Battletech-ish game with lots of cannons and rockets and gatling guns and other hoo-haw, and I've found that if I fire too many weapons at once for a long enough time, the physics engine just stops calculating raycasts entirely.

All bullet trajectories and collisions and such are all done using raycasts, the most expensive of which being a gatling gun that fires 70 rounds per second, each of the bullets flying through the air and checking for collisions with raycasts.

But the game does not chug even with multiple gatling guns firing at once; it's just at some threshold all projectiles stop colliding with walls, my robot's feet stop detecting the ground, and everything else raycast-related stops working.

The raycasts all just start returning "false." Even after letting up on all weapons, letting the projectiles all clear, and then firing again, raycasts are still not calculated.

Any idea what the heck is going on? Does Unity just get tired of doing so many raycasts and throw in the towel?

Comment
Add comment · Show 5
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 Nidre · Apr 10, 2013 at 12:04 PM 0
Share

Well thinking of how many ray casts you are doing in each second Unity might not be able to calculate fast enough so they could be passing the object before Unity can calculate.I would try to decrese the number of bullets per second.$$anonymous$$aybe u can still show like u are shooting 70 bullets per second but behind the scenes you can actually shoot 10 of them and multiply each of their damage with 7 so you will get similar results with better performance.

avatar image whydoidoit · Apr 10, 2013 at 12:05 PM 1
Share

Sounds rather bug like to me...

avatar image Nidre · Apr 10, 2013 at 12:17 PM 0
Share

The raycasts all just start returning "false." Even after letting up on all weapons, letting the projectiles all clear, and then firing again, raycasts are still not calculated.

i dndt see that part. $$anonymous$$aybe you can test you Raycast with drawing same gizmos as same as them ? There might some kind of bug as whydoidoit mentioned.

avatar image aldonaletto · Apr 10, 2013 at 12:40 PM 1
Share

Looks like a Physx bug to me. There's no official limit for raycasts - the only problem should be a loss in performance. I once found myself a Physx bug in raycasts: after teleporting the player to some specific place, the enemy raycasts could not see it anymore - I had to change my code to work around this.

avatar image Fattie · Apr 10, 2013 at 07:45 PM 0
Share

Sgt dude --- I swear, I have been having spooky RayCasting behaviour with unity the last few days.

(I did not update to 412 which just arrived this $$anonymous$$ute.)

For example: just for no totally explicable reason, a raycast stopped working altogether in some button code that I have used 88 zillion times.

It was driving me freaking nuts all afternoon. Eventually: Unity crashed, and when I came back the problem was gone. WTH !

And then there's this !!

http://answers.unity3d.com/questions/433906/terrifying-supernatural-timescale-setting-changed.html

0 Replies

· Add your reply
  • Sort: 

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

14 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

Related Questions

how detect "OnRaycastOut" 1 Answer

How to use raycast on generated objects. 0 Answers

Raycasting not behaving as expected? 2 Answers

Some raycasts don't hit the object 0 Answers

Problem with raycast distance 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