Original date: June 11, 2022
Finished a new enemy in today’s stream: the Creeper. This guy moves (“creeps”) along a wall and fires a constant laser beam. It’s more of a mix between an enemy and an obstacle. Currently thinking if I create maybe a stationary turret version of it that fires a more conventional weapon, maybe plasma bolts or something. Not sure yet, we’ll see.
Have to admit, creating this one was a bit annoying. Normally the enemies constantly do a raycast at the player to know where the player’s ship is and when it’s close enough to attack. Creeper does so, too, but it kept switching between aggro and not aggro because in like 90% of cases the raycast hit the wall instead of the player. Quite obvious in the end. Unless otherwise specified, the raycast starts at the caster’s origin. Not going to work well if the origin is within a wall. Still surprised some of them came through.
Also had the issue that I check the Creeper’s orientation to know in which directions it moves. For example, if it’s at 0°, it points upward and moves left to right. If it’s at 90°, it points to the right and moves up and down. The former worked, the latter didn’t, the check never became true. Turns out: in the inspector, the Creeper’s rotation was set at 90°. However, a quick print(rotation_degrees) revealed: in-game the rotation was at something like 89.97763°. Little bastard!
Leave a Reply