Hello,
I’m trying to make a move for my game that makes the player throw a small landmine onto a wall, and the top of it will face away from the wall
The two circles represent the top and the front of the object

I’m using RaycastResult.Normal to determine which way the mine will face, and I tried using LookVector as a direction for the raycast, but for some reason it ignores the LookVector of the mine. I don’t know why that is.
local mine = game.ReplicatedStorage.Projectiles.Landmine:Clone()
mine.Parent = workspace
mine.CFrame = cf * CFrame.new(0,1,-3)
local landminePos
local landed = false
local part = Instance.new("Part",workspace)
part.Anchored = true
part.CFrame = mine.CFrame * CFrame.new(0,0,-5)
part.CanCollide = false
part.Transparency = 1
game.Debris:AddItem(part,0.1)
local BV = Instance.new("BodyVelocity",mine)
BV.MaxForce = Vector3.new(100000,100000,100000)
BV.Velocity = mine.CFrame.LookVector * 40
BV.Velocity = BV.Velocity + Vector3.new(0,8,0)
game.Debris:AddItem(BV,0.04)
local look = part.CFrame.LookVector
local PartPos = part.Position
---- This doesn't seem relevant to the problem ----
repeat
local ray = Ray.new(mine.Position,Vector3.new(0,-1.5,0))
local ray2 = Ray.new(mine.Position,(mine.Position - PartPos).Unit * 2)
local hit,position
local list = {mine,char}
local finalPos
local finalHit
local maxHit = 5
for i = 1, maxHit do
hit,position = workspace:FindPartOnRayWithIgnoreList(ray,list)
list[#list + 1] = hit
if rayFilter(hit) then
finalPos = position
finalHit = hit
break
end
end
for i = 1, maxHit do
hit,position = workspace:FindPartOnRayWithIgnoreList(ray2,list)
list[#list + 1] = hit
if rayFilter(hit) then
finalPos = position
finalHit = hit
break
end
end
if finalHit then
landed = true
landminePos = finalPos
end
game:GetService("RunService").RenderStepped:Wait()
until landed == true
-------------------------------------------------
local ray2 = workspace:Raycast(mine.Position,Vector3.new(0,-2,0))
if ray2 and ray2.Instance.CanCollide == true and ray2.Instance.Parent:FindFirstChild("HumanoidRootPart") == nil then
end
mine.Position = landminePos
mine.Anchored = true
------- v Here's the real problem v -----
local rrray = workspace:Raycast(mine.Position,look * 5) --- This is most likely the source of the problem
if rrray then
mine.Orientation = rrray.Normal
mine.Orientation = mine.Orientation + Vector3.new(0,0,90)
end
Here is the result of this:

It only rotates when placed on specific walls when I want it to apply to all walls
