Props

In addition to NPCs, you can also spawn and control objects. There are more than 15000 objects in the GTA V database that can be accessed and searched through this index. From yachts to paintings, from flower vases to rocks, they vary in scale and properties and constitute all the objects that are present in the game world.

Objects are referred to as Prop variables in the code, and similarly to Ped and Vehicle they are a GTA Entity data type. To create a new prop you can use the World.CreateProp function. This needs the following parameters:

  • a string with the prop file name,

  • the relative of absolute 3D coordinates of where the prop should be created,

  • the 3D rotation value (optional, if not specified the prop will have default rotation values),

  • a true/false boolean to set the object as dynamic or static,

  • a true/false boolean for snapping the object on the ground or spawning it at an arbitrary position.

GTA.World.CreateProp(Model model, Vector3 position, Vector3 rotation, bool dynamic, bool onGround)

Let’s create a Prop variable called MyProp and let’s make an alarm siren appear 3 meters in front of the player, with default rotation, set as a dynamic object and snapping to its original position.

Prop MyProp = World.CreateProp("xm_prop_x17_sub_alarm_lamp", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, -3)), true, false);

By default the siren is placed on top of a ceiling, so it will appear above the player.

To delete a prop you can call the Prop variable you created and use the Delete() function:

MyProp.Delete();

You can also remove Collisions by using the IsCollisionEnabledboolean to false:

MyProp.IsCollisionEnabled(false);

There are several hundred different light objects within the game’s database. You can use these objects to manipulate the light for your shots, just like a photographer would do in the studio.

Try spawning “prop_spot_clamp_02” to get harsh spot lights

Prop MyProp = World.CreateProp("prop_spot_clamp_02", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 3)), (new Vector3(62, 5, 0)), true, false);

Below is a list of objects casting lights which can be used to light up the scene in different ways.

 //STUDIO WHITE TRIPOD LIGHT (COLD)
Prop MyProp = World.CreateProp("ch_prop_tunnel_tripod_lampa", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 0)), true, false); //set to true to place on ground or adjust the Z position (by default is about 1 m from the ground)
//STUDIO WHITE TRIPOD LIGHT (WARMER)
Prop MyProp = World.CreateProp("xm_prop_base_tripod_lampb", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 0)), true, true); //set to true to place on ground or adjust the Z position (by default is about 1 m from the ground)
//STUDIO WHITE TRIPOD LIGHT (STRONGER)
Prop MyProp = World.CreateProp("xm_prop_base_tower_lampa", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 0)), true, true); //rotation is fixed, set to true to place on ground or adjust the Z position (by default is about 1 m from the ground)
//LIGHT BOX (WARM)
Prop MyProp = World.CreateProp("xm_prop_base_wall_lampa", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 0)), GameplayCamera.Rotation, true, false); //use custom rotation to direct light, set to true to place on ground or adjust the Z position (by default is about 1 m from the ground)
//LIGHT BOX (COLD)
Prop MyProp = World.CreateProp("xm_prop_base_wall_lampb", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 1)), true, false); //fixed rotationl, set to true to place on ground or adjust the Z position (by default is about 1 m from the ground)
//WHITE NEON LIGHT (no tripod)
Prop MyProp = World.CreateProp("xm_prop_base_tripod_lampc", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 0)), true, true); //the neon light is vertical, set to true to place on ground or adjust the Z position (by default is about 1 m from the ground)
//NEON LIGHT GROUP OF 3 (vertical)
Prop MyProp = World.CreateProp("xm_prop_lab_tube_lampa_group3", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 0)), true, true); 
//NEON LIGHT GROUP OF 6 (vertical, different colours: modify ending with _g, _p, _r, _y for green, pink, red, yellow)
Prop MyProp = World.CreateProp("xm_prop_lab_tube_lampa_group6_g", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 0)), false, false); 
//ARENA LIGHTS
Prop MyProp = World.CreateProp("xs_propintarena_lamps_01a", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 0)), GameplayCamera.Rotation, false, false);
//STROBO LIGHTS
Prop MyProp = World.CreateProp("ba_prop_battle_lights_fx_riga", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 2)), GameplayCamera.Rotation, false, false);
//4 FLOATING SPOTS LIGHTBOX (modify ending to get different color hues: _lr1 to _lr9)
Prop MyProp = World.CreateProp("ba_prop_battle_lights_int_03_lr1", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 2)), GameplayCamera.Rotation, false, false);
//WHITE WASH CEILING LAMP
Prop MyProp = World.CreateProp("prop_chall_lamp_02", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 0)), true, false);
//WHITE SPOT LAMP
Prop MyProp = World.CreateProp("prop_spot_clamp_02", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 3)), true, false); //adjust the Z position (by default is on the floor)
//MULTIPLE WHITE LIGHTS SETUP
Prop MyProp = World.CreateProp("v_ilev_carmodlamps", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 0)), true, false); //adjust the Z position (by default is on the floor)
//SOFT WHITE WASH
Prop MyProp = World.CreateProp("v_ilev_fh_lampa_on", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 0)), true, false); //adjust the Z position (by default is at player's face height)
//CEILING WHITE NEON (HARSH)
Prop MyProp = World.CreateProp("xm_base_cia_lamp_ceiling_01", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 3)), true, false); //adjust the Z position (by default is about 1 m from the ground)
//CEILING WHITE SPOT (HARSH)
Prop MyProp = World.CreateProp("xm_prop_base_silo_lamp_01a", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 0)), true, false); //adjust the Z position (by default is about 1 m from the ground)
//FLOOR SOFT WHITE WASH TILE
Prop MyProp = World.CreateProp("xm_base_cia_lamp_floor_01a", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 0)), true, true); //set to true to fix on the ground
//RED SIREN CEILING LIGHT (SIREN ON = xm_prop_x17_sub_al_lamp_on SIREN OFF = xm_prop_x17_sub_al_lamp_off SIREN OFF CASTING LIGHT = xm_prop_x17_sub_alarm_lamp)
Prop MyProp = World.CreateProp("xm_prop_x17_sub_alarm_lamp", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, -5)), true, false); //set false and adjust value to position in the Z axis (by default is positioned on the ceiling)
//RED WASH
Prop MyProp = World.CreateProp("v_ilev_cd_lampal", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 0)), true, false); //adjust the Z position (by default is on the ceiling)
//LIGHT BLUE WASH CEILING LAMP
Prop MyProp = World.CreateProp("prop_chall_lamp_01n", Game.Player.Character.GetOffsetPosition(new Vector3(0, 3, 0)), true, false);