Game Development Reference
In-Depth Information
enemyRed
I've added two rectangles in the scene to represent walls and gave them a
wall
tag. Then, I
started using
OnComponentHit
that is caused by the
sphere
component of the enemy
blueprint.
We check whether the enemy hit a
wall
tagged actor with the
Actor Has Tag
node, or an-
other
enemy
tagged component with the
Component Has Tag
node. If yes, then the en-
emy changes its movement direction by changing the
velocity
direction of the
projectile
component and changing
scale
of
sprite
between
1
and
-1
to emulate a flip.
Search WWH ::
Custom Search