GSC reference › Built-in
Attach()
Built-in (engine)
Server
Called on: entity
Attach a model to an entity.
Signature
<entity> Attach(<modelname>, [tagname], [ignoreCollision])
Called on an entity: entity Attach(...)
Parameters
| Name | Required? | Details |
|---|---|---|
| modelname | Required | The model name to attach (string). |
| tagname | Optional | The tag to attach the model to (string). |
| ignoreCollision | Optional | flag to ignore collision. Defaults to false (integer). |
Example (from Treyarch's docs)
self Attach( "panzerflak_ammo", "tag_weapon_left" )
Real uses in BO3's scripts
Called 85 times in the decompiled scripts. A few, zombies first:
- scripts/zm/_zm_clone.gsc, line 63
clone attach(weaponmodel, "tag_weapon_right"); - scripts/zm/_zm_weap_dragon_gauntlet.gsc, line 360
self attach(self.var_f2a52896, "J_Elbow_RI"); - scripts/zm/_zm_weap_shrink_ray.gsc, line 230
self attach(var_89a773f5); - scripts/zm/_zm_weap_staff_fire.gsc, line 719
self attach(self.var_f08c601 + "_fire"); - scripts/zm/_zm_weap_staff_water.gsc, line 760
self attach(self.var_f08c601 + "_ice");
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).