I want it to print what the camera is looking at but it will only print a part of the character (note: I blacklisted the character) or "Ray Hit Nothing"
Here is the code:
camera = workspace.CurrentCamera player = game.Players.LocalPlayer character = player.Character local function Shoot(start, direction) local rayParams = RaycastParams.new() rayParams.FilterType = Enum.RaycastFilterType.Blacklist rayParams.FilterDescendantsInstances = {character} local ray = workspace:Raycast(start, direction, rayParams) if ray then print(ray.Instance) else print("Ray Hit Nothing") end end while true do Shoot(camera.CFrame.Position, camera.CFrame.LookVector) wait(1) end
please help :( thanks
The direction has a length of one, it should work if you multiply it by some larger number e.g.
Shoot(camera.CFrame.Position, camera.CFrame.LookVector * 1e4)
(1e4 is short for 10000 btw)