Unity component and method reference
Find the native Kit components and public C# methods for player control, weapons, vehicles, checkpoints, HUD, health and game flow.
Native conversion · importer 0.3.11
PlayerController
Namespace: Zimension.Kit. Owns the CharacterController, third/first-person camera, avatar Animator, selected target, inventory, ammo and mounted vehicle. CurrentWeapon and CurrentVehicle describe the active equipment. weaponGripCorrection is baked from the animation rig's hand frame.
| Method | Behaviour |
|---|---|
| Equip(Weapon weapon) | Drop a previously held weapon and attach the new weapon to the right-hand grip. |
| DropWeapon() | Detach the current weapon and restore its imported scale. |
| Teleport(Vector3 position, float yaw) | Move the player, resolve nearby floor placement and reset movement velocity and camera pitch. |
| SetSpawn(Vector3 position, float yaw) | Change the pose used by subsequent respawns; does not move the player. |
| Respawn() | Restore health and teleport to the active spawn pose. |
| Damage(float amount) / Heal(float amount) | Adjust player health and trigger the appropriate game flow. |
| AddAmmo(string weaponClass, int amount) | Add reserve ammunition shared by weapons in the same class. |
| Mount(Vehicle) / Dismount(Vector3) | Driver-side implementation. Use Vehicle.Enter/Exit for normal gameplay so both components stay in sync. |
Weapon
Authored holdPosition/holdEuler are relative to the hand grip. muzzle is the imported gunFireTransform child. Weapon.keepWorldSize is enabled by default. The component exposes onPickup, onDrop, onFire and onReload UnityEvents.
Pickup stops root placement animation so it cannot pull the gun away from the hand. The camera determines the intended aim point, then the muzzle ray checks the actual hit and intervening cover.
| Method or property | Behaviour |
|---|---|
| TryFire() | Fire when the cooldown, magazine and reload state allow it. |
| Reload() → bool | Start reloading when there is room in the magazine and reserve ammo is available. |
| Rounds / Reloading / Firing / Aiming | Read current magazine and animation-driving states. |
| AttachTo(player, hand) / Detach() | Low-level attachment methods. Prefer PlayerController.Equip/DropWeapon to keep ownership in sync. |
Vehicle
Exposes handling, wheel/steering references, driver mode, camera settings, engine audio, onEnter and onExit. Uses arcade ground-following movement. F or E exits; exit clears interaction selection and places the player outside the vehicle bounds.
| Method | Behaviour |
|---|---|
| Enter(PlayerController player) | Mount the player, initialize the chase camera and raise onEnter. |
| Exit() | Stop the vehicle, dismount the driver and raise onExit. |
| Stop() | Set current vehicle speed to zero. |
| RefillBoost(float seconds) | Restore boost up to the configured duration. |
GameManager and checkpoints
| Method | Behaviour |
|---|---|
| Begin() | Begin play once and run the logic's OnStart. |
| Pause() / Resume() | Control time scale, cursor and the default pause screen. |
| ResetPlayer() / RespawnPlayer() | Respawn at the current player checkpoint; RespawnPlayer also closes the death screen. |
| ResetWorld() | Reload the current Unity scene. |
| LoadScene(string sceneName, float fadeSeconds = 0.35f) | Carry generated project variables and switch scenes, optionally with a fade. |
| ApplySpawnPointEvent(string eventName) | Apply the active scene's matching checkpoint/teleport bindings. Called from generated event methods. |
| Builtin(string name) | Handle supported Zimension built-in events. |
| Win() | Show the default win screen and release the cursor. |
GameHud
| Method | Behaviour |
|---|---|
| SetPrompt(string action, bool pickup) | Set the current interaction/pickup prompt. |
| ShowMessage(string text, float seconds = 4f) | Display a timed message. |
| ShowScreen(GameHud.ScreenKind screen) | Show None, Start, Pause, Dead or Win. |
| SetWaypoint(Transform) / ClearWaypoint(Transform) | Control the default waypoint marker. |
| FadeOut(float seconds) / FadeIn(float seconds) | Fade the default HUD using unscaled time. |
Other Kit components
| Component | Role and extension points |
|---|---|
| Health | Damage(float), Heal(float), Kill(); onHit, onDie and onRespawn callbacks, health bar and respawn options. |
| Interactable / Collectable | Interaction and pickup behaviour configured from authored settings and UnityEvents. |
| PlayerZone / ItemContact | Player-enter/exit and object-contact callbacks from bounds checks. |
| CharacterBehaviour / RuntimeNavMesh | Supported NPC behaviour and navigation setup. |
| ProceduralMotion | Play() and Stop() control supported in-place motion; held weapons reject placement motion. |
| AnimationEvents / StateFinished / SoundFinished | Completion callbacks connected by the generated project logic. |
| WorldItemId / LocalVariables | Source identity and item-local variable storage. |
| UnityMath.SetWorldScale(Transform, Vector3) | Attachment scale compensation, including scaled or mirrored parent rigs. Namespace: Zimension.Unity. |
Check the package source
Public signatures and serialized settings can change between importer versions. Open Packages/com.zimension.runtime/Runtime/Unity/Kit in the downloaded project for the implementation matching your installed package. The separate editor conversion code lives under Editor/Conversion.
