๐Ÿ‘‹
Auto Hand Docs
  • ๐Ÿ™ŒAuto Hand
    • โ€ผ๏ธAuto Hand V4 What's-New
    • โšกSetup
    • ๐Ÿ—’๏ธFAQ
    • โ‰๏ธCommon Issues
    • ๐ŸงคSetup New Hand
    • ๐ŸŽฎController Input
      • โœŠHand Input
      • ๐ŸคŸHand Tracking Input
      • โœŒ๏ธFinger Pose Input
      • ๐ŸƒPlayer Input
      • ๐Ÿ—’๏ธGeneral Input / UI Pointer Input
      • ๐Ÿ‘ˆDistance Grabber Input
      • โšกTeleport Input
      • ๐ŸŽAdditional Input
    • ๐Ÿ–๏ธHand
      • ๐Ÿ”ฆGrabbable Highlighter
      • ๐Ÿ‘‹Hand Follow
      • ๐ŸซณHand Animator
      • โ˜๏ธFinger Component
      • ๐ŸงคHand Projector
    • ๐Ÿ––Hand Tracking
      • ๐Ÿ‘ŒHand Tracking Finger Gesture Tracking
      • ๐Ÿ‘ˆHand Tracking Pose Gesture Tracking
    • โœ๏ธCustom Poses
      • ๐ŸฆพHand Pose Data
      • โœ‚๏ธAnimated Held Poses
    • ๐Ÿ…Grabbable
      • ๐ŸงฒDistance Grabbing
    • ๐ŸงบPlace Point
    • ๐Ÿ“คDispenser Point
    • ๐Ÿ›ธTeleportation
    • ๐Ÿ‘ŸAuto Hand Player
    • ๐ŸงFull Body (VRIK)
    • โš’๏ธExtras
      • ๐Ÿ”ซAuto Gun
        • ๐Ÿ’˜Auto Ammo
        • ๐ŸŽฏAuto Gun Target
      • โš™๏ธGrabbable Held Joint
      • ๐ŸŽ›๏ธPhysics Gadgets
        • ๐Ÿ”˜Physics Gadget Button
        • ๐ŸŽš๏ธPhysics Gadget Slider
        • ๐ŸŽ›๏ธPhysics Gadget Lever
      • ๐Ÿ“UI Interaction
      • ๐Ÿ“ฑHand Touch / Trigger
      • ๐Ÿ”จSmashing
      • ๐Ÿ”ชStabbing
      • ๐ŸŽฏStickies
      • ๐ŸงฒMagnetic Forces
      • ๐Ÿ“ขCollision Sounds
      • โŒšWrist Look Event
Powered by GitBook
On this page
  • Gun Events
  • Auto Ammo
  • Auto Gun Effects
  1. Auto Hand
  2. Extras

Auto Gun

PreviousExtrasNextAuto Ammo

Last updated 1 year ago

Auto Gun component will manage shooting, ammo, and slide reloading logic. Auto Gun system includes built in logic for ,,

The gun takes a called Magazine Point that should be configured to take the appropriate grabbables with the Auto Ammo component.

The gun does not keep track of its ammo directly it only knows if it has one bullet in the chamber or not, and if it has an placed in its Magazine Point

If an is place in this point you can call the AutoGun.LoadSlide() event from a function or from a Unity Event to load that first bullet into the Auto Gun (in the Demo the rifle's slide uses a component which calls the LoadSlide() event from it's Unity Event)

Shooting the gun will automatically reload the slide until there is no more ammo in the or if the clip has been removed

Shoot Forward Determines the origin and direction for bullet raycasting, essential for calculating bullet paths.

Automatic Fire Rate how quickly the gun will repeat fire, in seconds, while holding down the trigger. Set to 0 for semi-automatic

Hit Force The physics force applied to the target's rigidbody when hit

Kick Back Force The physics force applied to the gun when shooting

Use Bullet Penetration If true the gun will hit every target until it hits a static collider

Require Slide Loading whether or not the LoadSlide() function needs to be called externally or if it is automatically called when the ammo is loaded

Auto Eject Empty Clip Whether or not the ammo clip should automatically be removed from the place point when it's empty

Gun Events

On Shoot called when the gun is successfully shot, using an ammo

On Empty Shoot called when the shoot event is called but there is no ammo

On Hit when a target is hit

On Ammo Place called when a new ammo is placed in the ammo place point

On Ammo Remove called when a new ammo is removed from the ammo place point

On Slide Load called when the LoadSlide() or FireLoadSlide() function is called. Includes an enum to distiguish between a hand load event and a fire load event

Auto Ammo

This component should be attached to any object being used in the Gun's attached Magazine Point Place Point. Without this component the placed object won't be considered valid ammo

Current Ammo The current amount of ammo left in this clip

Ammo Text Updates to show the ammo count whenever it changes

Auto Gun Effects

This is an additional component that can be added onto the Auto Gun to add additional visual/audio details without coding a new script. This script is not required and does not change how the core gun works

Eject Unfired Bullet Whether or not racking the slide with a bullet already in the chamber ejects that bullet or not

Bullet This is the unfired bullet prefab that will be instantiated and ejected if the 'ejectUnfiredBullet' value is true and the slide is racked while full

Bullet Shell This is the fired bullet shell prefab that will be instantiated and ejected when the gun is shot

Shoot Particle This is the fired bullet shell prefab that will be instantiated and ejected if the when the gun is shot

Ejected Bullet Lifetime The lifetime of the ejected bullets before they are added to the pool

Shell Ejection Spawn Point The position and rotation where the bullets are instantiated

Shell Ejection Direction The forward direction of this point represents the direction the shells should be ejected

Shell Ejection Force The amount of force to add to the ejected bullet

Shoot Sound This sound will play when a bullet is fired

Empty Shoot Sound This sound will play when a the trigger is pressed and there is nothing to shoot

Slide Joint (Optional) is recommended for triggering the LoadSlide() event, if connected this will trigger the slide movement when shooting. (Check the events on the rifle slide in the demo for example)

Magazine Point The place point for the ammo, this should only take objects this gun considers ammo. Ammo grabbables should always include the Auto Ammo component

๐Ÿ™Œ
โš’๏ธ
๐Ÿ”ซ
Grabbable Held Joint
Place Point
Auto Gun Target
Place Point
GrabbableHeldJoint
Auto Ammo
Auto Gun Effects
Auto Ammo
Auto Ammo
Auto Ammo