I was working in my last game, and everytime that i need to handle with RayCast ive got a little confused.
So, to help me to exactly understand what happen with my raycasts, i work out on a simple module function that can show me the behavior of my ray.
Obviously, im using the old datatype called Ray to do this, but its easily to change the module if u wanna.
How To Use
Import the module:
local PrintRay = require(--[[Put the path to archive here]]--)
Then just call it passing a ray and a number that will be used to split the ray into this segments.
local NewRay = Ray.new(Vector3.new(0,0,0), Vector3.new(5,5,5))
PrintRay(NewRay, 15)
The Ray object is deprecated and today people mostly use workspace:Raycast instead; so this module won’t work for developers using the newer method. Other than that, it’s good I guess.
The Ray class is not deprecated. Only the old raycasting API is (WorldRoot:FindPartOnRay et al). Methods like camera:ViewportPointToRay still return ray objects, but if you want to do raycasting with them you can still use the new API, you just make use of the Origin and Direction properties of the returned object. So this is fine.
First of all: At no point do I use something that has been deprecated. Ray is an Object, at no time do I use FindPartsOnRay().
You don’t understand the basics, and want to come talk nonsense about someone who is publishing something trying to help others.
Your reply was obsolete and didn’t help anyone. You could’ve just refrained from writing it altogether. I don’t use the same method - still - I appreciate him trying to help others.