- Home /
Attack script help needed
I wanna know a good way to use an attack. When I start the animation, move the box collider with the object, and that if the collider hits anything other than the player, then the script rolls.
Thanks, Pedro Loures
Answer by Caiuse · Nov 15, 2011 at 11:26 AM
Some reading:
http://unity3d.com/support/documentation/ScriptReference/Collider.OnTriggerEnter.html
http://unity3d.com/support/documentation/ScriptReference/Component.SendMessage.html
Edit (in response to your question below):
If you want to add something like a sword then simply make a sword (with a collider) the child of the hand.
sword.transform.parent = hand.transform;
Answer by Blackice000 · Nov 15, 2011 at 12:38 PM
Of that I knoew Caius, what I wanted to know is how to make the box collider of the axe move with the animation.
I hit the LMB to attack and put in scene to see it, and the box collider from the axe is in the same place as it was before the animation. I want it to move with the axe.
Answer by Blackice000 · Nov 15, 2011 at 10:32 PM
Got it almost working. The problem on the script now is that the axe box collider is always being triggered by the Character Controller, how to fix that? Because even if I attack, it doesn't name the other. Yes, I am using the Debug.Log to check the name of what's colliding.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Hit and Damage System with interfaces 4 Answers
Super Sonic Movement Help 1 Answer
Raycast/Melee Attack Help Please! 1 Answer