- Home /
Question by
bobrovapaula · Dec 30, 2018 at 02:01 PM ·
unity 5aienemy
I have written these two enemy scripts but the enemy doesn't move? (2d)
alt text
enemyattack.png
(118.6 kB)
enemyhealth.png
(54.6 kB)
Comment
How should a health or attack scripts make the enemy move? $$anonymous$$ake a movement script ins$$anonymous$$d.
If it is a 2D game you should be using OnTriggerEnter2D.
Best Answer
Answer by Thom_Denick · Dec 30, 2018 at 06:50 PM
@bobrovapaula It looks like you're moving the GameObject that you're attaching your EnemyAI script to, and not the actual enemy (Check the transform.translate line in Update on the image in the comments.) just putting transform in there is moving the EnemyAI GO, not the Enemy.