So my raycast always starts at the origin even though I want to start at the bottom of the part.
Code:
local part = script.Parent
local height = 3
local size = part.Size.Y / 2
local rayOrigin = part.Position - size
local rayDirection = Vector3.new(0, -height, 0)
local raycast = workspace:Raycast(rayOrigin, rayDirection)
You can’t subtract a scalar value from a vector; you need to specify what is being subtracted and from where - the code below should be the corrected version of what you’re attempting.
local rayOrigin = part.Position - Vector3.new(0, size, 0)
However, I’m unsure if this would work for rotated parts; perhaps try this instead?
local rayOrigin = part.Position - part.CFrame.UpVector * size