{"name":"setObjectMaterial","operator":null,"title":"setObjectMaterial","type":"command","url":"https://community.bistudio.com/wiki/setObjectMaterial","revid":370026,"updated":"2024-10-27T23:18:53Z","groups":["Object Manipulation"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma3","name":"Arma 3","version":"0.50"},"arma3_since":"0.50","branch":null,"locality":{"argument":"global","effect":"local","server_exec":false},"exec":null,"description":"Sets material of object selection. The selection number is defined through the hiddenselection[] = {} array in the vehicle's config (starting with 0).","syntaxes":[{"syntax":"obj setObjectMaterial [selectionNumber, material]","since":null,"effect":null,"exec":null,"params":[{"name":"obj","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"obj: Object"},{"name":"selectionNumber","type":null,"optional":false,"default":null,"description":"Number or String (since Arma 3 v2.10).","types":["Number","String"],"since":null,"text":"selectionNumber: Number or String (since Arma 3 v2.10)."},{"name":"material","type":"String","optional":false,"default":null,"description":"material path. Since Arma 3 v2.20 using **\"#reset\"** would reset to default material.","types":["String"],"since":null,"text":"material: String - material path. Since Arma 3 v2.20 using **\"#reset\"** would reset to default material."}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"obj","types":["Object"]},"right":{"text":"[selectionNumber, material]","types":["Array"]}}],"examples":[{"text":"```sqf\ncar setObjectMaterial [0,\"A3\\Structures_F\\Data\\Windows\\window_set.rvmat\"];\ncar setObjectMaterial [1,\"A3\\Structures_F\\Data\\Windows\\window_set.rvmat\"];\n```","code":["car setObjectMaterial [0,\"A3\\Structures_F\\Data\\Windows\\window_set.rvmat\"];\ncar setObjectMaterial [1,\"A3\\Structures_F\\Data\\Windows\\window_set.rvmat\"];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["getObjectMaterials","setObjectTextureGlobal","getObjectTextures","setObjectTexture","setObjectMaterialGlobal"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Manipulation","Introduced with Arma 3 version 0.50","Scripting Commands","Scripting Commands: Local Effect"]}