i have a simple problem i have a local script and when the player clicks this code runs but this doesn't work thank you
if mouse.Hit==game.Workspace.twofive.CFrame then
print("hiiiiiiiiiiiiiiiiiit")
end
i have a simple problem i have a local script and when the player clicks this code runs but this doesn't work thank you
if mouse.Hit==game.Workspace.twofive.CFrame then
print("hiiiiiiiiiiiiiiiiiit")
end
mouse.Hit is a CFrame. CFrames have to be precise to be compared equal to each other. The part itself will have the cframe at the center of its volume. The mouse.Hit will have the cframe at the edge of the part where the part interrupted the ray.
To fix this problem, instead do:
if mouse.Target == workspace.twofive then
print("Hit")
end
This discussion is preserved as it was. New answers, comments, and votes are closed.