Hi there. I ran into a issue where a fishing rod that I made would pull me along with it when I fired it.
I’ve already tried setting all parts to Massless but it didn’t work. I’ve also started to try to extend the rope constraint while the Lure is moving but that didn’t work either.
Can you please provide me the script? I believe we cannot help you without the code that you put in the rod. You will need to show us the script code before we can investigate on what you messed up on
What is Lure? I am not sure what lure does to the player and how it fires the fishing rod to be casted outside. I am curious on which thing you used. The script looks legitimate to me. You may need an anchored part so it cannot drag the player. You would need a debounce for the top of the rod, so it can cast out like a normal fishing rod.
Make a part unanchored for the top of the rod. The thing needs to be unanchored for a short amount of time so you could add a Wait() next to anchored an unanchored part that triggers the rod for it to pass the thing. When it stops make the part unanchored.
Took me a while, but I got it working / looking better. I used velocity instead of the body velocity, projectile motion to make casting look nicer / get the ball to stop rolling with bodygyro.
server script:
local isCasted = script.Parent.Casted
local tip = script.Parent.Tip
function getVelocity(player, mousePosition)
local time = 1;
local gravity = Vector3.new(0, -game.Workspace.Gravity, 0);
local initialPosition = player.Character.HumanoidRootPart.CFrame * Vector3.new(0, 8, -1)
local velocity = (mousePosition - initialPosition - 0.5*gravity*time*time)/time;
return velocity
end
function createLure(player, mousePosition)
local lure = Instance.new('Part')
lure.BrickColor = BrickColor.new('Light orange')
lure.Material = "Neon"
lure.CanCollide = true
lure.Shape = 'Ball'
lure.Size = Vector3.new(0.5, 0.5, 0.5)
lure.Name = "Lure"
lure.CustomPhysicalProperties = PhysicalProperties.new(1, 0, 0, 1, 1)
lure.Parent = script.Parent
lure.CFrame = player.Character.HumanoidRootPart.CFrame + Vector3.new(0, 8, -1)
lure.Velocity = getVelocity(player, mousePosition)
return lure
end
function createRope(lure, mousePosition)
local Attachment = Instance.new('Attachment')
local mag = (mousePosition - script.Parent.Tip.Position).Magnitude
local rope = Instance.new('RopeConstraint')
rope.Thickness = 0.05
rope.Visible = true
rope.Length = math.clamp(mag, 10,30)
rope.Attachment0 = tip.Attachment
rope.Attachment1 = Attachment
rope.Name = "Rope"
rope.Parent = lure
Attachment.Parent = lure
return rope
end
script.Parent.Mouse.OnServerEvent:Connect(function(player, lookVector, mousePosition)
if lookVector then
if not isCasted.Value then
isCasted.Value = true
local lure = createLure(player, mousePosition)
local rope = createRope(lure, mousePosition)
game:GetService("ServerStorage").Fishing.WeldLure:Clone().Parent = lure
wait(.5)
--stop ball from rolling
local bodyGyro = Instance.new("BodyGyro")
bodyGyro.Parent = lure
while true do
wait()
bodyGyro.CFrame = lure.CFrame
end
else
isCasted.Value = false
script.Parent:WaitForChild("Lure"):WaitForChild("Rope"):Destroy()
script.Parent:WaitForChild("Lure"):Destroy()
end
else
isCasted.Value = false
end
end)
local script:
local player = game:GetService("Players").LocalPlayer
local mouse = player:GetMouse()
script.Parent.Equipped:Connect(function()
script.Parent.Activated:Connect(function()
local camera = workspace.CurrentCamera
local unitRay = camera:ScreenPointToRay(mouse.X, mouse.Y)
local ray = Ray.new(unitRay.Origin, unitRay.Direction * 40)
local partHit, position = workspace:FindPartOnRay(ray, player.Character)
script.Parent:WaitForChild("Mouse"):FireServer(ray.Direction, position)
end)
end)
script.Parent.Unequipped:Connect(function()
script.Parent:WaitForChild("Mouse"):FireServer()
end)
I think that the lure is actually somehow connecting itself with the character’s HumanoidRootPart as when I anchored the humanoidrootpart, the lure stopped moving entirely.