{"name":"deleteVehicle","title":"deleteVehicle","type":"command","url":"https://community.bistudio.com/wiki/deleteVehicle","revid":352346,"updated":"2024-02-08T14:01:50Z","groups":["Object Manipulation"],"status":"ok","games":{"ofp":"1.34","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.34","arma3_since":"0.50","locality":{"argument":"global","effect":"global"},"description":"Deletes an object. Only objects inserted in the mission editor and objects created during the game's progress can be deleted by this command. Terrain objects and players cannot be deleted.\n\n> [!NOTE]\n> The actual object deletion, when the object becomes objNull, happens on the next frame after command execution, but there are some object modifications that happen immediately. For example if the object is a unit in a group, it immediately becomes groupless (`isNull group _unit; // true`).","syntaxes":[{"syntax":"deleteVehicle object","params":[{"name":"object","type":"Object","type_expr":"Object"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"unary","right":{"text":"object"}},{"syntax":"deleteVehicle objects","since":"arma3 2.18","params":[{"name":"objects","type":"Array of Objects","type_expr":"Array<Object>"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"unary","right":{"text":"objects"}}],"examples":[{"code":["deleteVehicle _house1;"]},{"text":"Deleting a vehicle with crew:\n\n```sqf\n// might want to make sure that the car is local\n{ car deleteVehicleCrew _x } forEach crew car;\ndeleteVehicle car;\n```","code":["// might want to make sure that the car is local\n{ car deleteVehicleCrew _x } forEach crew car;\ndeleteVehicle car;"]}],"problems":"> [!WARNING]\n> Use deleteVehicleCrew to delete units that are in a vehicle! Do **not** use this command for a vehicle's crew members as it may lead to all sorts of bugs and ghost objects left on the map.","see_also":["deleteVehicleCrew","createUnit","createVehicleLocal","createVehicle","Arma 3: Event Handlers"]}