a crucial element of a project I’m working on currently is seamless teleportation of players between two identical sections of the map. I currently have this working flawlessly for the user’s own character, however when implementing this for multiplayer, someone’s character model would appear to glide/interpolate to the destination, ruining the effect of the game I’m making. I’ll include a short video of this happening.
tl;dr:
I need some way of making other player’s teleportation instantaneous.
important info:
the teleportation is done only on the client-side for the user controlling the teleporting character. This is done by setting the primary part CFrame of the character.
the video was recorded in a local 2 player server inside Studio. [I had both windows open at once, hence the low resolution]
If you know a solution for this issue, I don’t mind if it involves scripting or simply changing some properties.
edit: looking back on the recording I attached, it appears as though the teleportation is sometimes instant, however when viewing the game itself, all of the teleports look more like the second one in the recording, but extended out for about 2 times as many frames. I believe this may just be a side effect of Roblox’s inbuilt recorder’s lower frame-rate.
And as an actual possible solution to your problem here, assuming this is purely due to Roblox’s way of handling the movement between two clients… then along with the teleport, you could fire a remoteevent to the other players with your teleportlocation to instantaneously move the character and skip all of that assumably Roblox-caused interpolation.
I’m working on an infinite staircase concept. The basic idea is that when going up one floor, you’ll end up on the floor you left. Currently I’m achieving this by seamlessly teleporting a player down or up a floor when they go too far up or down, giving the staircase the appearance of an infinitely tall set of stairs.
In order to complete the illusion in multiplayer, other player’s characters are duplicated one floor above them, and one floor below. They are then animated and positioned correctly each frame for the client, theoretically creating an illusion the player going up one floor, and appearing from the one below
Let me know how it goes, and if it doesn’t go the way you wanted it to then I’ll see if I can come up with something else (assuming I haven’t already went to bed).
the only other solution I’d thought of would be to create a custom player movement system and directly set the position of other players in the game. However, this would have the downside of having no interpolation when the players are walking normally, and cause the movement of other players to stutter.
edit: turns out this works, and I think until I find a better solution, I may just have to deal with the slight stutter when people walk
I think your solution is best, the only possible issue I can think of is that after the one frame of the player being teleported instantly, roblox might take over and try to interpolate like normal, causing the player to teleport backwards slightly.
unfortunately it does seem like what I thought may have been an issue was the case, the method of using a remote event works for one frame, but then the character seems to teleport backwards and continue with the interpolation for another few frames. It’s kind of a shame, I was really hoping it would be an easy fix, oh well.
I have found the solution, which was in the end just to send the position data of the character to other players in the server each frame, and then use the position data received, and move the characters of other players using this. I’m also considering making my own interpolation for when the characters aren’t teleporting, as the jitter/jumping movement is definately visible.