---
name: "setObjectTextureGlobal"
type: command
status: ok
groups: ["Object Manipulation"]
arma3_since: "1.06"
locality: {"argument": "global", "effect": "global", "server_exec": false}
source: https://community.bistudio.com/wiki/setObjectTextureGlobal
revid: 370029
updated: 2024-10-27T23:21:01Z
---

# setObjectTextureGlobal

*Command · Object Manipulation · Arma 3 v1.06*

Locality: arguments **global** · effect **global**

## Description

Set the texture of the given selection on all computers in a network session.

> [!NOTE]
> - Not all objects can be textured this way. To find out, run [getObjectTextures](../commands/getObjectTextures.md) command on an object. Empty array `[]` usually indicates it cannot be textured.
> - All textures must have a resolution of 2a × 2b (e.g. 16×16, 16×32, 64×256, 512×512, ...). The largest texture size supported by the RV engine is 4096×4096.
> - Supported formats: .pac, .paa, .jpg, .jpeg, .ogg, .ogv

## Syntax

```sqf
object setObjectTextureGlobal [selection, texture]
```

**Parameters:**

- `object`: [Object](../topics/Object.md)
- `selection`: [Number](../topics/Number.md) or Arma 3 v2.10 [String](../topics/String.md) - index of the selection. It is defined in the hiddenSelections array in the vehicle's config (starting with 0). If a string is given, it referes to a hiddenSelection name or clan selection instead of an index.
- `texture`: [String](../topics/String.md) - path to texture. Since Arma 3 v2.20 using **"#reset"** would reset to default texture.

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
player setObjectTextureGlobal [0, "\MyAddon\blue.paa"];
```

### Example 2

```sqf
// Set up a persistent texture keeper
player addEventHandler ["Take", {
    (getObjectTextures player + [uniformContainer player getVariable "texture"])
    params ["_texUniform", "_texInsignia", "_texCustom"];
    if (isNil "_texCustom") exitWith {};
    if (_texUniform == _texCustom) exitWith {};
    player setObjectTextureGlobal [0, _texCustom];
    false
}];

// Example: make current uniform persistently blue

private _texture = "#(rgb,8,8,3)color(0,0,1,1)"; // blue texture
player setObjectTextureGlobal [0, _texture]; // set it on player
uniformContainer player setVariable ["texture", _texture, true]; // store it on uniform
```

## Multiplayer

The effect is [JIP](../topics/Multiplayer_Scripting.md#join-in-progress) compatible.

## Problems

If executed from an object's init field (which should not be done anyway for Global Effect commands), execution may happen too early and fail to broadcast over the network and to be [JIP](../topics/Multiplayer_Scripting.md#join-in-progress) compatible.

## See also

[setObjectTexture](../commands/setObjectTexture.md) · [getObjectTextures](../commands/getObjectTextures.md) · [setObjectMaterial](../commands/setObjectMaterial.md) · [forceFlagTexture](../commands/forceFlagTexture.md)

## Community notes

**Killzone_Kid** — 2016-10-24

Sometimes it could be necessary to set default material on an object for the texture to take effect:

```sqf
private _block = createVehicle ["Land_VR_Block_02_F", player getPos [20, getDir player], [], 0, "CAN_COLLIDE"];
_block setObjectMaterialGlobal [0, "\a3\data_f\default.rvmat"];
_block setObjectTextureGlobal [0, "#(rgb,8,8,3)color(1,0,0,1)"];
```

Courtesy of **Larrow**

---

**whiztler** — 2022-09-13

Following Killzone_Kid's note, a [sleep](../commands/sleep.md) after the  [setObjectMaterialGlobal](../commands/setObjectMaterialGlobal.md) and before the setObjectTextureGlobal command is sometimes needed to ensure the texture effect is  carried out correctly.

```sqf
private _block = createVehicle ["Land_VR_Block_02_F", player getPos [20, getDir player], [], 0, "CAN_COLLIDE"];
_block setObjectMaterialGlobal [0, "\a3\data_f\default.rvmat"];
sleep 0.01;
_block setObjectTextureGlobal [0, "#(rgb,8,8,3)color(1,0,0,1)"];
```

Note that you need to run above code in a [scheduled environment](../topics/Scheduler.md).

<sub>Source: [BI Community Wiki — setObjectTextureGlobal](https://community.bistudio.com/wiki/setObjectTextureGlobal) (revision 370029).</sub>
