Zum Hauptinhalt springen

Understanding Cube Weapon

Cube Weapon separates shared weapon content from each weapon configuration and from its temporary actor representation. This chapter explains the roles used throughout the setup guide.

Weapon Masters and Parts​

A Weapon Master describes a platform such as an M4: its registered ID, mesh, slot providers, tags and base statistics. A Weapon Part describes a reusable attachment such as a barrel or suppressor. Compatible builds can share these assets without changing the definitions at runtime.

Weapon Builds​

A Weapon Build is FWeaponBuildData, containing a build GUID, a master ID and installed part records. It is a Blueprint structure. It can be stored in a project inventory, SaveGame or your own preset asset; Cube Weapon does not provide a separate Weapon Build Data Asset class.

M4 master + long barrel + red dot → marksman build
M4 master + short barrel + suppressor → compact build

Give independently editable weapons separate build GUIDs. Sharing a master or part asset is different from sharing an editable build identity.

Runtime Weapons​

Acquire creates or requests a weapon actor. Equip applies a registered build to that actor and assigns it to a Character socket. The runtime builder resolves assets, assigns mesh components and calculates statistics. Use selects an assigned actor and moves it to an active socket; Attack handles firing input.

Shared assets → build configuration → validated registry entry
↓
Acquired actor → Equip → runtime meshes and stats → Use → Attack

The actor is not an inventory record. Saving its reference does not preserve a weapon between sessions. Store its build configuration and any additional gameplay state separately.

Project Integration​

The Game Instance owns UWeaponSubsystem. Your PlayerController owns AC_WeaponNetComp and implements I_WeaponController. Your Character owns AC_WeaponCharComp and implements I_WeaponPawn. These connections provide operation routing, actor ownership, mesh attachment and animation callbacks.

Complete Project Settings, Character Integration and Your First Weapon. For internal functions and replication, see Technical Architecture.