Developer knowledge network ยท moderated exchange

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Knowledge indexLive
4Categories
919Threads
2.8KPosts
Tutorial

Safe Teleportation Algorithm: Pre-Loading World Collision Mesh via STREAMING::LOAD_SCENE [v2.4 Technical Discussion]

fivem_native_coder
Lua Scripter
MEMBER
Rep: 64
Join Date: Jun 2019
Posts: 20
Thanks: 48
1 months ago ยท Jul 2, 2026 7:04 PM
#1

Why instant coordinate teleportation causes players to fall through the map:

When you instantly write new coordinates to CVehicle or CPed, the streaming engine has not loaded the destination terrain collision mesh.

Safe Teleport Sequence:

  1. Freeze entity position (ENTITY::FREEZE_ENTITY_POSITION(ped, true)).
  2. Request collision tiles (STREAMING::REQUEST_COLLISION_AT_COORD(x, y, z)).
  3. Pre-load map scene (STREAMING::LOAD_SCENE(x, y, z)).
  4. Wait 100ms for terrain collision to stream in.
  5. Write target coordinates and unfreeze ped!

Zero falling through the map or getting stuck in low-poly LOD terrain!

raycast_ryan
Ballistics Dev
MEMBER
Rep: 72
Join Date: Sep 2019
Posts: 32
Thanks: 16
1 months ago ยท Jul 3, 2026 1:30 AM
#2

STREAMING::LOAD_SCENE is mandatory when teleporting across the map (e.g. Los Santos to Paleto Bay). Eliminates void falls.

null_deref
Reverse Engineer
MEMBER
Rep: 79
Join Date: Jan 2019
Posts: 42
Thanks: 46
1 months ago ยท Jul 3, 2026 1:47 PM
#3

Very reliable teleportation routine.