Hi, I have a sticky bomb but am having trouble with the sticking part of the bomb. Looks like I’m in a sticky situation … anyway. Here is the current piece of code I have and when the bomb lands, it disappears or goes somewhere far away in the map.
local weld = Instance.new("Weld")
weld.Parent = hit
weld.Part0 = hit
weld.Part1 = Object
weld.C1 = CFrame.new(mousePosition.p)
What am I doing wrong.
How can I fix this?
I need to use welds so I can stick bombs onto players.
Cheers,
You’re setting the weld CF to the hit cf. This will cause the weld to stay where the player clicked. You need to set the weld CF to a CF based off the position and part on the clicked object. Or you can just weld the Part to the player and set the partCFrame to the click.
It’s probably because it’s using the mouse’s position. You could use a WeldConstraint instead, since you don’t have to set the CFrame offset (as long as it’s already in the position you want it to be welded to)
I think it’s because of my throwing script. Is there anyway I could use tweening to tween the object to the mouse hit position but have it tween in a throwing motion like shown in this terrible diagram:
Because then the object would be at the position and I just have to weld it. I think it’s not welding properly because where the sticky bomb lands is not the mouse position