So, I am trying to make a script that when a fish Touches the Fishing rod, it becomes a child of it, I tried this script, but it doesn't work... Since I dont really know how to script, I dont know how to make an object a child of another when touched... If you notice any mistakes please tell me, I gain experience from you guys!
local fish = game.Workspace.Fish local WoodenFishingRod = game.StarterPack.WoodenFishingRod fish.Touched.WoodenFishingRod:Connect(function(touch) if touch.Name == "Fish" then fish = WoodenFishingRod print("Fish Captured!") end end)
Hello, here is how I would do it.
fish = script.Parent --Gets fish script.Parent.Touched:connect(function(hit) --Fires if fished touched if not hit:FindFirstChild("WoodenFishingRod") then return end --Checks touched by fishing rod fish.Parent = hit --sets fish parent to the fishing rod end)
I hope this helps!