- Home /
Brackeys EnemyAi Script
Hello, This is my first ever post, and need help with a certain script. A little context I just restarted game development so everything is new to me and was trying to make a 2D enemy ai, luckily Brackeys made a video a while back doing this exact thing. I got to work and everything was working fine until we made the EnemyAi script where instead of using components like AIPath, seeker, etc he put it into one large script, and of course, with my luck and skill, I have a problem where the Ai will just fly off the screen nowhere near the target or even interested. This only with the EnemyAi script since it's only applied to Enemy 1, if I use the original enemy without the script it works fine. In this post, I will have a short video of unity to show what happens and a link to the code in question. Hope this is enough information for assistance and thank you in advance to the person/people who help me. Hope everyone has a great day! Here is a link showing my problem in unity: https://drive.google.com/file/d/1nMlUbbmcF0yh1d_Tf2_HsnDT7ILhL84l/view?usp=sharing
Here is a link to the EnemyAi script: https://paste.myst.rs/vos9jvfr
And if it helps here's the video that I'm following: https://youtu.be/jvtFUfJ6CP8 Note: He starts talking and doing the EnemyAi script at exactly 10:40 so skip to that time to get right into the script.