Developer knowledge network · moderated exchange

UnreliableCode Topluluğu

Geliştirici Araştırması, Tersine Mühendislik ve Kodlama Topluluğu

Knowledge indexCanlı
4Categories
919Threads
2.8KGönderiler
Tutorial

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

fivem_native_coder
Lua Scripter
MEMBER
Temsilci: 64
Katılım Tarihi: Jun 2019
Gönderiler: 20
Teşekkürler: 48
1 ay önce · 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
Temsilci: 72
Katılım Tarihi: Sep 2019
Gönderiler: 32
Teşekkürler: 16
1 ay önce · 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
Temsilci: 79
Katılım Tarihi: Jan 2019
Gönderiler: 42
Teşekkürler: 46
1 ay önce · Jul 3, 2026 1:47 PM
#3

Very reliable teleportation routine.