Developer knowledge network · moderated exchange

مجتمع الكود غير الموثوق به

أبحاث المطورين، مجتمع الهندسة العكسية والترميز

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 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
مندوب: 72
تاريخ الانضمام: Sep 2019
دعامات: 32
شكرًا: 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
مندوب: 79
تاريخ الانضمام: Jan 2019
دعامات: 42
شكرًا: 46
1 months ago · Jul 3, 2026 1:47 PM
#3

Very reliable teleportation routine.