Results 1 to 5 of 5

Thread: Question Regarding Physics.cast

  1. #1

    Question Question Regarding Physics.cast

    Hello, Forum.

    I’m working with sphere and ray casts, and encountering the following periodic error:

    “Error in Script (Global) function <Physics.cast>: exceeded the maximum number of hits”

    My first response to this error was to employ pauses between the physics casts (which, by the way, happen within a coroutine). This seemed to help things, but hasn’t made the issue go away.

    I would note that I’m not running any physics casts in parallel with one and other; just one at a time. Also, my script doesn’t appear to malfunction, despite the error message popping up from time to time.

    I’m not at liberty to post any code examples right now. Instead, I was wondering if anyone else has encountered this error and successfully handled it. Perhaps it can be safely ignored? If so, is it possible to silence the error message?

    Finally, does anyone know what the maximum number of allowed hits is for a physics cast?

    Many thanks in advance for any insights!

    -Al

  2. #2
    In this case you have too many objects (hits) in the range of the cast. I am not sure what the limit is, but you're hitting it.

  3. #3
    Interesting. I wonder how pauses between physics casts would seem to reduce instances of the error? Perhaps they don't, but it appeared they did due to coincidence?

    Thanks for the feedback, cche!

    -Al

  4. #4
    wow... may we see a screenshot of your scene.. as I have never seen that before and I have used a cast on token bowls and Rosenberg tile blocks and stuff that have tons of individual objects in them.
    My Boardgame uTube chan - Tragic's Table Top
    BGG Guild of BoardGame uTubers - Tube Tables

  5. #5
    Quote Originally Posted by Tragic View Post
    wow... may we see a screenshot of your scene.. as I have never seen that before and I have used a cast on token bowls and Rosenberg tile blocks and stuff that have tons of individual objects in them.
    Turns out, I've now dealt with the situation. The issue was a grid of marker objects (more than 1000 of these) in addition to whatever else I had on the game board. The markers are small and, quite simply, I was so used to seeing them that I'd forgotten they were subject to sphere/ray casts like any other object! The solution was to make the grid toggle-able, so that it could be temporarily removed during game play.

    At some point, I'll definitely put out screen shots of the OC I'm building, but not until after some beta testing I'm doing with a small group of folks.

    If anyone is interested in what I'm building, please see my other post: http://www.berserk-games.com/forums/....php?5528-AIMS

    Thanks,

    -Al

Similar Threads

  1. Cast fails to find...
    By cche in forum Scripting
    Replies: 4
    Last Post: 04-12-2018, 12:40 AM
  2. Replies: 2
    Last Post: 11-13-2017, 07:54 AM
  3. Physics.cast ray, debug extending past where it actually affects
    By DeathKnight in forum Scripting Bug Reports
    Replies: 1
    Last Post: 07-26-2017, 06:42 AM
  4. [ADDED] Physics.cast() should also collide with the table.
    By Mark in forum Scripting Suggestions
    Replies: 0
    Last Post: 06-11-2017, 10:11 AM
  5. [CLOSED] Please cast your vote!
    By Kimiko in forum General Discussion
    Replies: 50
    Last Post: 03-20-2014, 08:31 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •