{"name":"preloadObject","title":"preloadObject","type":"command","url":"https://community.bistudio.com/wiki/preloadObject","revid":369157,"updated":"2024-09-03T10:34:40Z","groups":["Object Manipulation"],"status":"ok","games":{"ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofpe 1.00","arma3_since":"0.50","description":"Preloads all textures, materials and proxies needed to render given object. Works with objects and classnames - note that classnames require an object instance in the mission.","syntaxes":[{"syntax":"distance preloadObject object","params":[{"name":"distance","type":"Number","description":"distance at which preload the object","type_expr":"Number"},{"name":"object","type":"Object or String","description":"Object or String\n\n- Object - existing object\n- String - object classname - an object of that type **must** exist in the mission for it to have effect","type_expr":"Object | String","text":"object: Object or String\n\n- Object - existing object\n- String - object classname - an object of that type **must** exist in the mission for it to have effect"}],"returns":{"type":"Boolean","type_expr":"Boolean","description":"true when preload is finished"},"form":"binary","left":{"text":"distance"},"right":{"text":"object"}}],"examples":[{"text":"```sqf\n0 spawn\n{\n    waitUntil { 10 preloadObject \"SoldierW\" };\n    hint \"Preload finished\";\n};\n```","code":["0 spawn \n{\n\twaitUntil { 10 preloadObject \"SoldierW\" };\n\thint \"Preload finished\";\n};"]},{"text":"```sqf\n0 spawn\n{\n    waitUntil { 10 preloadObject leader player };\n    hint \"Preload finished\";\n};\n```","code":["0 spawn \n{\n\twaitUntil { 10 preloadObject leader player };\n\thint \"Preload finished\";\n};"]}],"see_also":["preloadCamera","preloadSound","preloadTitleObj","preloadTitleRsc"]}