Dash distance is different in game, and when testing is studio

As the title says, in my fighting game theres dashes, and for some reason the dash in roblox studio is normal but when i test it in the real game its completely off

Dash in roblox studio:

its fine.
but heres the dash in roblox:

its much longer and the physics feels off!
this is the code that i use for the dash (its client sided)

for i = 0, dashDuration, rate do
		print(i)
		if breakDash == true then
			break
		end
		if dashDirection == "Front" then
			if num == 5 then
				if i < 0.55 then
					local Result = CustomEvents.Result2:InvokeServer(char, Vector3.new(5,2,5), 0, true, nil, false, nil, -5)
					if Result ~= nil then
						break
					end
				end
				
				num = 1
			else
				num += 1
			end
			
			bv.Velocity = hrp.CFrame.LookVector * dashStrength

if anyone knows how to fix it, or why is it like this thanks!!!

1 Like

I believe this line is what is causing the issue. Since the dash is loop count based and not time-based, the duration per loop relies solely on this InvokeServer line. This is because InvokeServer waits for a response from a server, and due to client-server delay (ping) this delay can vary based on the server’s ping. In Roblox Studio, the server is run on your local device, resulting in very low ping. However, in the actual game, the servers are hosted by Roblox, meaning that the ping increases, causing the overall loop sequence to take longer.

I’m not sure why you need to invoke the server to determine if the loop should break, and am pretty sure you could just handle that on the client end.

Let me know if you had any questions!

1 Like

Thanks!!! ill try changing my code a bit so it handles it on the client. ill tell you how it goes

Yep, that fixes it. Thanks a lot!