GSC reference › Built-in
CanShoot()
Built-in (engine)
Server
AI Called on: actor
Check to see if the actor can shoot the given position.
Signature
<actor> CanShoot(<shoot at position>, [offset from gun])
Called on an entity: actor CanShoot(...)
Parameters
| Name | Required? | Details |
|---|---|---|
| shoot at position | Required | (vector) The position to shoot at. |
| offset from gun | Optional | (vector) The offset from the gun muzzle from which to calculate collision. |
Example (from Treyarch's docs)
canShoot = self CanShoot( eye, offset )
Real uses in BO3's scripts
Not called anywhere in BO3's shipped scripts, so check it works in your mode before relying on it.
Related built-ins
- CanShootEnemy()Check to see if the actor can shoot his current enemy.
- IsActorShooting()Checks whether this entity is an ai is shooting
- Shoot()Makes this actor shoot.
- GetShootAtPos()Gets the position an attacker would shoot at to hit this entity.For AI or player this is the eye position.For other entities it's the tag_eye if...
- ShootTurret()Shoots a turret
- StopShootTurret()Stops a turrent from firing.
- ShootUp()Gives an entity vertical movement
- ZombieShooterSpotted()Enables the Zombie Shooter Spotted HUD display
- SetGoal()Set this AI 's goal.
- ForceTeleport()Force Teleport the actor to a new position with the given origin and angles, regardless of wether it will be visible to the player or not.
- OrientMode()Set the orient mode of this actor.
- AnimMode()Set the way that animation deltas are interpreted by the game engine
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).