#teleport indicator charging at my camera

1 messages · Page 1 of 1 (latest)

shell wharf
#

i was trying to make a cylinder indicate where i tp when i use a tool but for some reason it keeps flying towards my camera

#

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

marble mirage
shell wharf
#

ill try that

marble mirage
#

And be sure to filter your Cylinder with Mouse.TargetFilter

shell wharf
#

ok

#

oh wait

#

i think that was he problekm

marble mirage
shell wharf
#

cuz it believed the cylinder rwas the part so it kept teleporting to it and backed out

#

lemme trry

marble mirage
#

your right

shell wharf
#

lemme ty fix it

#

try*

#

IT WORKED TYSM