I’m not sure what type of game you’re making, but you can cast a Ray 45 degrees downward from the front of a piece using what @JarodOfOrbiter said:
local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = {model}
raycastParams.FilterType = Enum.RaycastFilterType.BlackList
local rootPart = model.PrimaryPart
local origin = rootPart.Position
local distance = 8
local direction = (rootPart.CFrame.LookVector - rootPart.CFrame.UpVector).Unit * distance
local raycastResult = workspace:GetPartOnRay(origin, direction, raycastParams)
if raycastResult then
-- Code
end
I think he means 45 degrees along the board like how a chess piece would move, in which case youd do exactly this but replace upvector with rightvector
You can also get different 45 degree angles by doing:
-lookvector-rightvector (this gets back left)
Or
-lookvector+rightvector (this gets back right)
Or
lookvector-rightvector (this gets front left)
or
lookvector+rightvector (this gets front right)
But yeah just do what he said but make those small edits