Raycast should directly return the hitEntity and hitResult

Right now World:Raycast() triggers simultaneous / on the same frame. But we still have to provide a callback function to get the hitEntity and hitResult.

It would be a nice QoL change if the Raycast function directly returned those results.


Can you give me an example of how this feature would improve your workflow? Is there some sort of bug that is being caused?

It doesn’t actually impact me in any way, I just have to write more lines / more complicated code.

script:GetSaveData() was initially async and had a callback due to that. Now, where it was improved, it was changed so it does return the save data.
I think this was a good design decision since callbacks (intuitively spoken) hint, that something is either async or is passed somewhere else to be called from there. Since the callback is not passed anywhere, where the player can use it further, i dislike the decision to have Raycasts create a function closure/callback only for the engine (or whatever handles it).

I agree to Vilva on that, Raycasts should return the hit entity and result. The callback doesn’t feel right and contradicts the idea that lead to script:GetSaveData() becoming usable without a callback.