ProjectileShooter
A class in Root.Township, Alta.Intelligence.
Component that spawns and fires a projectile from a creature, aimed forward or at its target with some random spread. Server only; nothing in code calls Shoot, so prefab events probably do.
- Listed in Creatures and AI
- Inherits or implements
MonoBehaviour - Nested types
AimMode
Constructors
| Member | What it is |
|---|---|
ProjectileShooter() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
7 private and internal fields
| Member | What it is |
|---|---|
private Agent agent | The creature shooting. Its target is aimed at and it becomes the projectile's Shooter. |
private ProjectileShooter.AimMode aimMode | How to aim: Forward, Target, or a mix of forward and the target direction for the vertical or horizontal part. |
private Transform direction | Transform whose forward is used as the forward aim. Falls back to this transform. |
private float maximumAccuracyAngle | Largest random spread in degrees (default 5). 0 shoots perfectly straight. |
private Projectile projectilePrefab | The projectile spawned. |
private float velocityMaximum | Highest launch speed (default 15). |
private float velocityMinimum | Lowest launch speed (default 15). |
Properties
Methods
| Member | What it is |
|---|---|
void Shoot() | Server: fires a projectile at the end of the frame. |