- Home /
Attack system?
Helloo guys, well I am currently working on an attack system for my game but I want to make it as simple as posible (keep things simple is very important for me) I have a couple of ideas like adding a detection range for attacks, if the enemy comes and play its attack animation close to my character, my health will go down (same thing with enemies) other way would be to give colliders to the swords of my characters and detect when they hit each other but I think that would be harder to code.
I just want to ask for other ideas or ways to implement this?
Answer by aldonaletto · Jan 11, 2012 at 10:42 PM
I answered a question some time ago about a simple melee attack: http://answers.unity3d.com/questions/193996/melee-combat.html
There's another question with a trigger attached to the weapon: http://answers.unity3d.com/questions/181106/sending-a-sendmessage-to-a-completely-different-ga.html
NOTE: This one was designed to be attached to the enemy's weapon, thus it checks if the target tag is "Player"; to hit enemies, you should compare the tag to "Enemy" or whatever tag you use to identify them.
thank you aldonaletto, I have seen tour profile and seems that you´re really good at program$$anonymous$$g I feel Im good but I need to learn a lot more, so can you give me any tips ? or how did you become the programmer youre now? books, intrernet, courses? time using Unity?
Thanks for the nice words! Well, I've got a lot of experience program$$anonymous$$g in other areas, but started working with Unity only about 18 months ago. What really made the difference for me was UA - answering questions here is the best thing to exercise the brain: I'm constantly checking the docs or googling around for physics, math, algebra, geometry, program$$anonymous$$g techniques etc.
About books, I suggest Beginning OpenGL - the 3D rendering concepts it shows are valuable even if you don't ever use the GL class in Unity.
Your answer
![](https://koobas.hobune.stream/wayback/20220613062905im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Attack Script 1 Answer
Particle system won't stick to player after shoot 0 Answers
Hi what aproach would you condsider to make this kind of attack system,video included.J 0 Answers
Accessing local system ( File Browser ) 2 Answers
help with goal detection system,Goal detection systems not working 1 Answer