Should i use :Teleport or :TeleportAsync

I dont know which of the two to use. Are there any benefits that oen offers that the other doesn’t?

I guess the only difference is that TeleportAsync is asynchronous, meaning the script yields (stops).

This could be beneficial if you want to do something once all players are teleported instead of whatever is next being run instantly while players are still being teleported.

Documentation: TeleportService:Teleport() TeleportService:TeleportAsync()

2 Likes

I think you mean async means the script does not yield and keeps going.

Sorry to bump a dead thread, but this was the first thing that came up when I had the same problem, and its just completely wrong. I’m sure it was a simple mistake.

edit: I may be wrong, the roblox wiki says that it does yield for some reason, even though the meaning of asynchronous is to not wait for a reply…

I don’t think that’s correct based on the “Yields” tag on Roblox’s documentation.

image

In my opinion, their use of “Async” is a bit confusing since you would it expect it not to yield but in most cases, Async functions do indeed yield.

Thanks, just realized that as I was reading the documentation right now. Roblox is really inconsistent for that.

Yea my best guess is that they label functions as Async to let users know that the function will make some type of network request or I/O operation which are actual async operations, and the calling thread will wait for those results. I don’t know for sure though.

1 Like

You should use TeleportAsync. Not only is a bit more advanced but, Teleport at some point will deprecate in favor of TeleportAsync.