Hi, I need help! I need to move the raycast so that it is in front of the player and looks down.
game.UserInputService.InputBegan:Connect(function(k,g)
if k.KeyCode == Enum.KeyCode.E then
local part = Instance.new(“Part”);
part.Anchored = true;
part.CanCollide = false;
part.Parent = workspace;
local plr = game:GetService(“Players”).LocalPlayer;
local char = plr.Character or plr.CharacterAdded:Wait();
local humrp = char:FindFirstChild(“HumanoidRootPart”);
local dir = part.CFrame.UpVector;
local params = RaycastParams.new();
params.FilterType = Enum.RaycastFilterType.Blacklist;
params.FilterDescendantsInstances = {char};
local ray = workspace:Raycast(humrp.Position,humrp.CFrame.UpVector * -20,params);
if ray then
part.Position = ray.Position;
end
end
end)
Full script