GetVehicleSkeletalMeshComponent
From Onset Developer Wiki
Description
Gets the skeletal mesh component of a vehicle.
Syntax
GetVehicleSkeletalMeshComponent(vehicle)
Parameters
- vehicle
The vehicle identifier.
Return Value
- Returns USkeletalMeshComponent and then can be used by UnrealLua.
Example
local function OnKeyPress(key)
local vehicle = GetPlayerVehicle(GetPlayerId())
if vehicle ~= 0 then
local VehicleSkeletalMeshComponent = GetVehicleSkeletalMeshComponent(vehicle)
if GetVehicleDriver(vehicle) == GetPlayerId() then
if key == 'H' then
VehicleSkeletalMeshComponent:SetPhysicsLinearVelocity(FVector(0.0, 0.0, 800.0), true)
end
if (key == '2' or key == 'é') then
VehicleSkeletalMeshComponent:SetPhysicsLinearVelocity(FVector(0.0, 0.0, 0.0), false)
VehicleSkeletalMeshComponent:SetPhysicsAngularVelocityInDegrees(FVector(0.0, 0.0, 0.0), false)
end
if key == "Left Mouse Button" then
local x, y, z = GetVehicleVelocity(vehicle)
local size = x * x + y * y + z * z
if (size < 25000000) then
local mult = 0.3
VehicleSkeletalMeshComponent:SetPhysicsLinearVelocity(FVector(x * mult, y * mult, z * mult), true)
end
end
end
end
end
AddEvent("OnKeyPress", OnKeyPress)
See also
- SetVehiclePropertyValue
- GetVehiclePropertyValue
- GetVehicleCount
- GetVehicleLicensePlate
- IsValidVehicle
- GetStreamedVehicles
- GetVehicleBoneLocation
- GetVehicleBoneNames
- GetVehicleModel
- GetVehicleLocation
- GetVehicleRotation
- GetVehicleVelocity
- GetVehicleForwardVector
- GetVehicleRightVector
- GetVehicleUpVector
- GetVehicleBoundingBox
- GetVehicleEngineRPM
- GetVehicleForwardSpeed
- GetVehicleGear
- GetVehicleWheelSurface
- IsVehicleWheelInAir
- IsVehicleInAir
- GetVehicleWheelSteerAngle
- IsVehicleHornActive
- GetVehicleEngineState
- GetVehicleLightState
- GetVehicleHoodRatio
- GetVehicleTrunkRatio
- IsVehicleInWater
- IsVehicleSeatOccupied
- GetVehicleDoorLocation
- GetVehicleHealth
- GetVehicleSkeletalMeshComponent