Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I detect an object being clicked with the mouse on a cloned model?

Asked by 7 years ago

So I have a placement system, and currently working on the inventory system to store items you've already purchased and placed.

I just used this simple print when a player clicks their mouse to see what its detecting.

mouse.Button1Down:connect(function()
    print(mouse.Target.Name)
end)

Say I have an item called "Test_Item", which has a Hitbox, and it's cloned from ReplicatedStorage into the Workspace and placed. Then, if I click it with my mouse, it does not send back "Hitbox", it just finds the ground below it and prints that. If I put the model in Workspace without the cloning/placement, it finds the Hitbox just fine.

I'm not sure what's going wrong... any help is appreciated.

Answer this question