Hello! I’m currently trying to make a tool which when you click gets thrown
But when you first click the part kind of goes up
and forward then starts moving which teleports upon clicking
Here’s the video of it happening
As you can see the part teleports upon me clicking
local tool = script.Parent
local part = tool.Handle
local ratio = 1
local debounce = false
tool.Activated:Connect(function()
if debounce then return end
debounce = true
local player = game.Players:GetPlayerFromCharacter(tool.Parent)
local character = player.Character or player.CharacterAdded:Wait()
local lv = character.HumanoidRootPart.CFrame.LookVector
local force = Vector3.new(lv.X * 40, 1, lv.Z * 40) * ratio + Vector3.new(0, game.Workspace.Gravity * 0.1 / ratio, 0)
tool.Parent = workspace
part.AssemblyLinearVelocity = force
debounce = false
end)
This is the code. Thanks in advance, and if you have any questions let me know
I’m not too certain, but I believe this is ROBLOX physics issue. There’s a couple ways you can fix it; maybe you can try changing the network owner? I’m not too much knowledgeable in this area…
Setting the velocity directly may lead to unrealistic motion. Using a VectorForce constraint is preferred, or use BasePart:ApplyImpulse() if you want instantaneous change in velocity.