RayCastResult.Instance creating error upon returning as nil even though there is an existent else
This error keeps printing when my ray.Instance returns as nil even though I have an else statement to provide another function. Sorry if this is explained poorly, it’s very late at night.
Any assistance helps!
Seems that you dont have a RaycastResult.
Check if there is a Result before trying to compare if the Object in the Result is nil or not:
if raycastResult then -- Your code warn(raycastResult.Instance) else warn("no raycast result") end
Thank you! I would’ve never probably thought about that, haha
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.