local player = game:GetService(“Players”).LocalPlayer
local char = player.Character
local Params = RaycastParams.new()
Params.FilterType = Enum.RaycastFilterType.Exclude
Params.FilterDescendantsInstances = {char}
local part = Instance.new(“Part”)
part.Parent = workspace
part.Anchored = true
part.Size = Vector3.new(1, 1, 1)
while task.wait() do
local result = workspace:Raycast( char.HumanoidRootPart.CFrame.LookVector * 5, char.HumanoidRootPart.CFrame.UpVector * -15, Params )
if result then
part.Position = result.Position
print(result.Instance)
end
end
1 Like
local pivot = character:GetPivot()
local origin = pivot.Position + pivot.LookVector * 5
local direction = pivot.UpVector * -15
local result = workspace:Raycast(origin, direction)
if not result then
return
end
-- ...
1 Like
thank you for your help, it got worked
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.