CreateRaycast

From GT-MP
Jump to: navigation, search
CreateRaycast
Client-Side Function
System-users.png Client-Side Javascript.png JavaScript

Client-side Function Description


Syntax

API.createRaycast(Vector3 start, Vector3 end, int flag, LocalHandle? ignoreEntity);

Required Arguments

  • start: parameter input should be in Vector3 type.
  • end: parameter input should be in Vector3 type.
  • flag: parameter input should be in int type. See Flags section below.
  • ignoreEntity: parameter input should be in LocalHandle? type.

NOTE: This function returns data in Raycast type.

Flags

Flag attributes are a set of bit flags, combinable by doing a bitwise OR. For example, if you want to hit Map and Mission_Entities, specify: 1 | 2

ID Name Description
-1 Everything
1 Map
2 Mission_Entities
10 Vehicles //seems like it hits peds too, waiting for confirmation
12 Peds1 //4 and 8 both seem to be peds
16 Objects
32 Unk1
64 Unk2
128 Unk3
256 Vegetation
512 Unk4

Usage example(s)

API.createRaycast(Vector3 start, Vector3 end, int flag, LocalHandle? ignoreEntity);

References