What i want to achieve? A grapple system with a prosthetic arm
I have the basics done, but when I go to grapple to a mouse target i feel like its not accurate
and if i let go half way through the grapple i get sent back to my previous position and sometimes it doesnt even grab onto the targeted surface, also the hook goes through the surface but i want it to stay on top and im not sure about how to fix these problems, any help would be appreciated
local tweenService = game:GetService("TweenService")
local debounce = false
game.ReplicatedStorage.Assets.Remotes.Grapple.OnServerEvent:Connect(function(player,mousepos,target)
local hook = player.Character.ProstheticArm.Hook
local hookWeld = hook.WeldConstraint
local root = player.Character.HumanoidRootPart
if target then
if debounce == false then
debounce = true
hookWeld.Enabled = false
hook.Anchored = true
tweenService:Create(hook,TweenInfo.new(1),{Position = mousepos}):Play()
wait(1)
debounce = false
end
end
end)
game.ReplicatedStorage.Assets.Remotes.GrappleOff.OnServerEvent:Connect(function(player)
local hook = player.Character.ProstheticArm.Hook
local hookWeld = hook.WeldConstraint
local hookRestraint = player.Character.ProstheticArm.HookRestraint
local root = player.Character.HumanoidRootPart
tweenService:Create(hook,TweenInfo.new(.5),{Position = hookRestraint.Position}):Play()
wait(.5)
hook.Anchored = false
hookWeld.Enabled = true
end)