#teleport indicator charging at my camera
1 messages · Page 1 of 1 (latest)
i believe this is the script
local function getMouseWorldPosition()
if not player.Character then return nil end
local root = player.Character:FindFirstChild("HumanoidRootPart")
if not root then return nil end
local mousePos = UserInputService:GetMouseLocation()
local ray = camera:ViewportPointToRay(mousePos.X, mousePos.Y)
local rayParams = RaycastParams.new()
rayParams.FilterDescendantsInstances = {player.Character}
rayParams.FilterType = Enum.RaycastFilterType.Blacklist
rayParams.IgnoreWater = true
local result = workspace:Raycast(ray.Origin, ray.Direction * 500, rayParams)
if not result then return nil end
local hitPos = result.Position
return hitPos
end
this is one part of the script
Maybe use Mouse.Hit (3d) instead of the Mouse position on the screen (2d).
ill try that
And be sure to filter your Cylinder with Mouse.TargetFilter
Here are the docs for it btw: https://create.roblox.com/docs/reference/engine/classes/Mouse#Hit
cuz it believed the cylinder rwas the part so it kept teleporting to it and backed out
lemme trry
Oh yeah you didn't filter the Cylinder inside your rayParams
your right