:ApplyImpulse() not moving the part

  1. What do you want to achieve? Keep it simple and clear!

Why the part is not moving

  1. What is the issue? Include screenshots / videos if possible!

I am making a fishing rod where when you click it casts a ball in the direction you click it doesn’t have any welds only a rope attached that I increase length before applying impulse.

local plrs = game:GetService("Players")
local tool = script.Parent
local tip = script.Parent.Tip
local rope = script.Parent.Tip.RopeConstraint
local bobber = script.Parent.bobber
local char = tool.Parent
local myplayer
local mospos = script.Parent:WaitForChild("mospos", 10)
local casted = script.Parent.Casted
local debounce = false


function OnEquip()
   debounce = true
   myplayer = game:GetService("Players"):GetPlayerFromCharacter(tool.Parent)
   rope.Length = 3.5
   wait(0.4)
   debounce = false
end

function VActivateds(player)
   if casted.Value == true then
   	if debounce then return end
   	debounce = true
   	rope.Length = 3.5
   	wait(0.1)
   	wait(0.5)
   	debounce = false
   	casted.Value = false
   elseif casted.Value == false then
   	if debounce then return end
   	debounce = true
   	wait(0.3)
   	local pos = mospos:InvokeClient(myplayer)
   	rope.Length = 50
   	wait(0.1)
   	local lookdir: Vector3 = CFrame.lookAt(tool.Handle.CFrame.Position, pos).LookVector
   	local Velocity: Vector3 = lookdir * 1500
   	bobber:ApplyImpulse(Velocity)
   	wait(0.5)
   	debounce = false
   	casted.Value = true
   end
end


tool.Equipped:Connect(OnEquip)
tool.Activated:Connect(VActivateds)

I am having same trouble on a grappling Gun :rofl:

I’m still looking around for solutions so I’ll reply If I find something

Make sure you didn’t anchor the model/part/thingy.

Do you want to make some project together?

Sorry I’d prefer not to, also the tool isnt anchored

I diserned that the problem isn’t with the applyimpulse its with the bobber I think, as when i make the impulse apply to a random part it moves.

Extremely late response to my question, the solution I found was to not worry with the impulse as using an animation fixed the problem. Since the ball had no constraints and was only connect via a rope an animation where my character flicked would cast the line

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.