EntityGetOffsetPosition Method

RAGE Plugin Hook Documentation

[This is preliminary documentation and is subject to change.]

Gets a position offset relative to this instance, based on the instance's position and direction.

Namespace:  Rage
Assembly:  RagePluginHook (in RagePluginHook.dll) Version: 0.0.0.0 (0.56.1131.11510)
Syntax

public Vector3 GetOffsetPosition(
	Vector3 offset
)

Parameters

offset
Type: RageVector3
The offset.

Return Value

Type: Vector3
A Vector3 representing the offset position.
Examples

This example spawns a vehicle with the model "POLICE2", 7 meters in front, and 3 meters to the left of the player's character, facing the same direction as the player's character.
Ped playerPed = Game.LocalPlayer.Character;
Vector3 spawnPosition = playerPed.GetOffsetPosition(new Vector3(-3f, 7f, 0f));
Vehicle car = new Vehicle("POLICE2", spawnPosition, playerPed.Heading);
Examples

This example spawns a vehicle with the model "POLICE2", 7 meters in front, and 3 meters to the left of the player's vehicle, facing the same direction as the player's vehicle.
Vehicle playerVehicle = Game.LocalPlayer.Character.CurrentVehicle;
if (playerVehicle != null && playerVehicle.IsValid())
{
    Vector3 spawnPosition = playerVehicle.GetOffsetPosition(new Vector3(-3f, 7f, 0f));
    Vehicle car = new Vehicle("POLICE2", spawnPosition, playerVehicle.Heading);
}
See Also

Reference