not sure how well I can explain this but here goes:
So the current method of raycasting I know of is where you send out an object that basically checks for collision either until it collides with something or exceeds the ray distance, which would work fine. However I had an idea for an alternate method which uses a one-time calculation instead of constant collision checks-
basically every time a ray is 'cast', it provides the length and direction of the ray (as well as the speed) and then it sends out a broadcast, which every object would react to (unless they were made to not collide with rays) in the form of an equation which I imagine would be something like (Xdistance - [x forward motion]) < XZHitbox
I have no idea how well this would actually work but I think it might work better, simply because it only runs once per ray compared to multiple times (and also saves on clone counts which doesn't really matter anywhere but scratch)
5 comments