Developer knowledge network · moderated exchange

Сообщество UnreliableCode

Сообщество разработчиков, обратного проектирования и кодирования

Tutorial

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

fivem_native_coder
Lua Scripter
MEMBER
Представитель: 64
Дата присоединения: Jun 2019
Сообщения: 20
Спасибо: 48
1 месяцев назад · 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
Представитель: 72
Дата присоединения: Sep 2019
Сообщения: 32
Спасибо: 16
1 месяцев назад · 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
Представитель: 79
Дата присоединения: Jan 2019
Сообщения: 42
Спасибо: 46
1 месяцев назад · Jul 3, 2026 1:47 PM
#3

Very reliable teleportation routine.