b3dGetVehiclePhysicsY

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

vehicleHandle Int

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.

Example

Example.bam
; Respawn vehicle if it falls below -50
If b3dGetVehiclePhysicsY(vehicle) < -50.0 Then
    ; Reset vehicle to spawn point
    b3dPositionEntity(vehicleMesh, 0, 10, 0)
    ; Reset physics (implementation depends on API)
EndIf