Developer knowledge network · moderated exchange

UnreliableCode қауымдастығы

Әзірлеушілерді зерттеу, кері инженерия және кодтау қауымдастығы

Knowledge indexТірі
4Categories
919Threads
2.8KЖазбалар
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.