Hello everyone,
I’m trying to use a raycast for an ability. However, the script doesn’t raycast correctly and I’m not sure why.
script:
local HumanoidRootPart = player.Character.HumanoidRootPart
local HitPosition = HumanoidRootPart.Position + (HumanoidRootPart.CFrame.LookVector * 20)
local PositionRayCast = workspace:Raycast(HitPosition,HitPosition - Vector3.new(0,10,0))
local Part = Instance.new("Part")
Part.Size = Vector3.new(1,1,1)
Part.Position = PositionRayCast.Instance.Position
Part.BrickColor = BrickColor.new("Really red")
Part.Material = Enum.Material.Neon
Part.Name = "HitPart"
Part.Parent = workspace
Part.Anchored = true
Part:Clone().Parent = workspace
what I’m trying to do is put a part infront of the player and then raycast underneth the part to check for any ground but the raycast doesn’t go downward.
Thank you