Replied to the wrong person above, please refer to message above…
Nevermind, I have fixed it by changing up the raycast way and using workspace:Raycast
Actually WorldRoot | Roblox Creator Documentation has been deprecated, so it’s better to use WorldRoot:Raycast
. This has multiple improvements over the Ray
object, including faster execution and less variables to work with. You can define the arguments for how you want to ray to work while casting the ray using a RaycastParams | Roblox Creator Documentation object. The best part is that the RaycastParams
object’s properties can be changed so you don’t have to create a new one. This function returns all the values the original ray object provided inside a RaycastResult | Roblox Creator Documentation userdata.
I used Raycast for the solution because of the raycastresult data, thank you though!