local event = game.ReplicatedStorage.Events.FireEvent
local tweenservice = game:GetService("TweenService")
event.OnServerEvent:Connect(function(plr,Mouse,look)
plr.Character.HumanoidRootPart.Anchored = true
local part = game.ReplicatedStorage.Ball:Clone()
part.Parent = workspace
part.CFrame = plr.Character.Torso.CFrame*CFrame.new(0,-5,-3)
local tweenInfo = TweenInfo.new(0.3) -- Change the duration as needed
local tween = tweenservice:Create(part, tweenInfo, {CFrame = CFrame.new(plr.Character.HumanoidRootPart.Position + look * 6)})
local downForce = - part:GetMass() * workspace.Gravity + 300
local force = -downForce
part.Value.Value = plr.Name
local bodyForce = Instance.new("BodyForce")
bodyForce.Force = Vector3.new(0,force,0)
bodyForce.Parent = part
tween:Play()
wait(0.4)
plr.Character.HumanoidRootPart.Anchored = false
part.Velocity = CFrame.new(plr.Character.HumanoidRootPart.Position, Mouse).LookVector * 150
end)
as you can see, the player’s torso should be anchored the moment the event fires, but there was still some room apparently for the player to go forward, any idea how i can fix it?
Hmm, yeah that is definitely not a latency issue. It seems to me like something is un-anchoring the rootpart. I would recommend trying to set the humanoid walkspeed to 0 instead of anchoring the rootpart.
nope, still the same problem. this is the client script if it helps:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local event = game.ReplicatedStorage.Events.FireEvent
local hum = script.Parent:WaitForChild("Humanoid")
local anim = hum:LoadAnimation(game.ReplicatedStorage.Animation)
db = false
mouse.Button1Down:Connect(function()
if db == false then
db = true
event:FireServer(mouse.Hit.Position,mouse.Hit.LookVector)
anim:Play()
wait(1)
db =false
end
end)