- Home /
Couple of questions regarding AI scripts and animation?
Im a beginner to unity3d, and dont have much knowledge about animation or scripting.I have a couple of questions to ask regarding scripting and animations.
1.Could anyone provide/teach me a script to make an enemy follow the target and attacking it with melee, as im working on a game, with enemies that have drills attached o it, so damage will be inflicted as the player comes in contact with it.
2.I needed a script that can make an animation start while I hold a button, and when I release it, the animation stops, and a new animation plays. I've been working on this a whole day, and cant seem to find a suitable script for it.
Any help would be appreciated, thanks alot!
That stuff you can find in the many wonderful unity tutorials in the resources page. Take a look at the FPS tutorial and the 3D platformer one, they should answer all your questions.
In general, it's usually a good idea to post separate questions as separate questions ins$$anonymous$$d of combining them into one bigger question. So this would ideally be one question on the AI scripts, and another one on the animations. That'll likely get you specific answers quicker.
I agree. If you take a look at the Unity's 3D Platform tutorial and the FPS tutorial you will get introduced to AI concepts and will be able to take those AI scripts as a base for your own game. Unity3D is one of those rare tools with a huge community and a lot of documentation and tutorials. Go ahead and take advantage of them !!!
Answer by jashan · Jun 16, 2010 at 05:12 AM
AI is "pretty advanced stuff", so when you don't have much knowledge with scripting and animation, it would probably be a good idea to start getting a good feeling for scripting and once you feel comfortable with basic scripting, move on to the more advanced stuff (like AI and scripting animations). Doing it the other way round (doing the advanced stuff first) will likely just result in frustration.
To start with scripting, you might follow the advice in this question. There's a few basic programming tutorials linked there, so that should get you started.
Once you're got those scripting basics covered, you'll find the tutorials that spinaljack mentioned and a few more here. I'm not sure how easy it would be to go through those tutorials with little programming knowledge, as those are not really programming tutorials. So in any case I'd still recommend doing pure programming tutorials first and those tutorials second.
Your answer
![](https://koobas.hobune.stream/wayback/20220613062226im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to make an animation play for AI? 0 Answers
I'm still having Trouble with this AI script 2 Answers
Unity3D AI using animations 1 Answer
Enemy Animation Freezing in first frame 2 Answers
Animay play in editor 0 Answers