client
SetEntityHeading
FiveM client native documentation with a Lua example.
Summary
Sets which direction an entity faces (0-360 degrees). Used after teleporting or spawning to orient peds and vehicles correctly.
Returns
void
Parameters
entitynumberThe entity handle.headingfloatThe heading in degrees (0-360).Example
SetEntityHeading(PlayerPedId(), 90.0)Common pitfalls
- Heading wraps at 360; values outside 0-360 are normalized.
- Set heading when teleporting so the player doesn't face a wall.
Related natives
Related guides
FiveM scripts done right
Optimized, dual-framework scripts for QBCore and ESX from Viper Development — escrow protected, delivered instantly to your Cfx portal.
Browse Scripts →