Returns vehicle physics body Y position (vertical position).
Takes vehicleHandle (vehicle from b3dCreateVehicle).
Returns current Y coordinate of vehicle physics body as Double.
3D Graphics
Parameters & Returns
Parameters
vehicleHandleInt
Returns
Double
Quick Summary
Returns vehicle physics body Y position (vertical position).
Takes vehicleHandle (vehicle from b3dCreateVehicle).
Returns current Y coordinate of vehicle physics body as Double.
Technical Exegesis...
Returns vehicle physics body Y position (vertical position in world coordinates). Takes vehicleHandle (vehicle created with b3dCreateVehicle and finalized). Returns current Y coordinate of vehicle physics body as Double in world units (vertical position, useful for detecting if vehicle fell off track or below ground, or for height-based effects). Reads position from Jolt physics body transform.
Returns vehicle physics body Y position (vertical position in world coordinates). Takes vehicleHandle (vehicle created with b3dCreateVehicle and finalized). Returns current Y coordinate of vehicle physics body as Double in world units (vertical position, useful for detecting if vehicle fell off track or below ground, or for height-based effects). Reads position from Jolt physics body transform.
Use cases: (1) Out of bounds detection (if Y < -100 then respawn vehicle), (2) Height effects (different physics on elevated roads), (3) Jump height tracking (measure max jump height), (4) Fall damage (calculate fall distance). Common patterns: respawn check (if b3dGetVehiclePhysicsY(vehicle) < -50 then resetVehicle), jump height (maxHeight = Max(maxHeight, currentY)).
Related: b3dPositionEntity sets entity visual position (physics Y may differ from visual during updates), b3dGetVehicleSpeed reads speed (useful for calculating fall velocity).
Example
Example.bam
; Respawn vehicle if it falls below -50If b3dGetVehiclePhysicsY(vehicle) < -50.0Then ; Reset vehicle to spawn point
b3dPositionEntity(vehicleMesh, 0, 10, 0)
; Reset physics (implementation depends on API)EndIf