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:
- Freeze entity position (
ENTITY::FREEZE_ENTITY_POSITION(ped, true)). - Request collision tiles (
STREAMING::REQUEST_COLLISION_AT_COORD(x, y, z)). - Pre-load map scene (
STREAMING::LOAD_SCENE(x, y, z)). - Wait 100ms for terrain collision to stream in.
- Write target coordinates and unfreeze ped!
Zero falling through the map or getting stuck in low-poly LOD terrain!