Bullet script
START Each frame move the
object forwards
When trigger volume
collides with another
If collided object
has tag of
“Team1”
Set target to be
the collided
gameobject
Get the health
component of the target
and deal the value of
damage to it
Destroy the bullet End of script
gameobject
EnemyHealth script
Start
If take damage is
called health is
lowered by preset
amount If health isn’t below
0
If current health
is 0 or less than
enemy dies
When enemy dies destroy
the object
End
PlayerHealth
Check every frame
Start If below 0 then die
whether health
has been lowered
to 0 or below
When die destroy the
player and print a
message to for
debugging
Shooting
start If player presses
left mouse
button
Else if not currently
clicking turn off laser
Turn on laser
effect and shoot
When shooting send out raycast
checking whether object is in
range and is an enemy
If not in range or
enemy nothing
happens If it is in range and
enemy then deal damage
to the enemy
end
Enemy movement
Every frame run
start movement, turning
and pathfinding
method
Move forward at a Turn to face the target
set speed over time
Shoot out rays in
multiple directions
to check for
obstacles
No obstacle found
If obstacle is
found in the
way
Move out of obstacles
way
Enemy respawn
start
Repeat spawning every
set time period
Spawn the enemy in each
time
Followcam
Find the position of
start
player
Every frame smoothly move
the camera to a specific
distance behind the player
Playermovement
start Every frame run the turn
thrust and acceleration
methods acceleration
Turn method If shift is pressed
changes
acceleration level
If button is If button is If button is
pressed changes pressed pressed
yaw changes pitch changes roll
thrust
Continuously move
forward at the
speed determined
by acceleration
Turret
start If not found
target
Check for target
entering a trigger
area
Target is locked
and turret turns
towards target
If target
goes out of
When the shot is range
ready turret then
shoots
After each
shot
Spawns a bullet object
in the world which will
move forward and
then waits a moment
until next shot is ready
and repeats unless
target has gone out of
range