How to Calculate the Speed or Time it would take for a part to go from Point A to Point B to sync up with an earlier part

Full Topic: How to Calculate the Speed or Time it would take for a part to go from Point A to Point B to sync up with a precious part that fired earlier in the same direction using tick()

Alright so I am having trouble calculating this and it is needed for the development of my guns. Basically bullets are fired from the client and the a server event is fired given the current tick() and other info then it fires all client and gives the Start and end position to them to replicate it. The issue is because of the delay, the bullets are just not synced up. My idea was to get rid of the delay by using the tick() from the start and the tick() from when the other clients receive the info and somehow use that to calculate a different speed to reach there on time. I don’t know if what I said made any sense, I will clarify if you need it. I appreciate any help, thank you.

1 Like

speed = distance/time

That equation might help a bit.

2 Likes

You’re not wrong, you could use the equation where
Speed = Studs/second
Distance = Studs
Time = Seconds.

But he was asking how to calculate it using the tick() function.

If you need help with syncing the client and server, then hopefully this could help you out, it’s a module used to sync tick with client and server by @Quenty;
NevermoreEngine/Modules/Time/TimeSyncManager.lua at 4bc3275ad8cfa0f703fae27b470dab9dc70254d2 · Quenty/NevermoreEngine · GitHub

2 Likes

Also checkout this, which will calculate it for you!

Uses TimeSyncService!

4 Likes