the title doesn’t do this justice cause I am super lost
if hitpos.Y <= target.Position.Y + target.Size.Y/2 and hitpos.Y >= target.Position.Y then
targetpoint = "Upper"
elseif hitpos.Y >= target.Position.Y - target.Size.Y/2 and hitpos.Y <= target.Position.Y then
targetpoint = "Lower"
end
this only works if its standing straight up
as seen here if laying down it screws up and I cant think of how to fix it.
please I beg of whoever can help, help please.
local Mouse = game.Players.LocalPlayer:GetMouse()
Mouse.Button1Down:Connect(function()
local hitpos = Mouse.Hit.Position
local target = Mouse.Target
local RelativeHit = target.CFrame:PointToObjectSpace(hitpos)
if RelativeHit.Y >= 0 then
print("Upper")
else
print("Lower")
end
end)
Technically the code block in the top tells if its hit the upper or lower area but it only works if the model/part is standing straight up. Does this check its local axis cause idk what that cframe line is lol.
edit: I made this reply on my phone so I couldn’t test it. thank you very much