Grab item script not working

i want to make grab script, when i hover and click on part(model,item, inc…) then the part going to float little and move to where my mouse go and i got confused about how make it if someone can help i will appreciate a lot.

123

i have no errors. just confused why its not working

3 Likes

It may just be because your If statement isn’t true when the event fires, what are you trying to detect as the mouse’s target?

4 Likes

i am trying to detect part on the workspace and i really dont know how to fix it

Maybe detect what the part is? Try debugging the target by printing its name

First off, the mistake you’re making here is that this piece of code runs when the player presses down their mouse button, instead you should make it so that when the player clicks down the mouse then it only checks whether it’s hitting a part or not and if it is, then you should use Mouse.Moved, to change the position of the object whenever the mouse moves until the player lifts their finger off of the mouse button using Mouse.Button1Up, also you shouldn’t check if the name of the instance the mouse was clicked on is named “part” or not, instead you should check whether the type of instance was a part or not, you can do this by using Instance:IsA, you can read about it here. Secondly, you should also check if the if statements are working properly or not, you can do this by printing at the if statements. I also recommend that you use tween service to make the part move around smoothly. You can read about tween service here.

1 Like

i know its not ok to ask but, can you make script example please?
i will appreciate a lot

I could, but you should try by your self, if you depend on me then you won’t learn anything new, so in my opinion you should try, regardless of whether you fail or not, and even if you do fail, tell me what’s going wrong, I’ll help you out at the best of my ability! :smile: