- Home /
character melee combat problem
I have a big problem that is what kind of method to do is the best. I have try the onControlColliderhit before...but it seem not detect so well So I think how about using raycast. But someone tell me that I can use trigger to detect enemy come inside my attack area. Then the problem is I dun want my character and enemy can run pass though each other. Then what can I do. And I want to know how to script on javascript.
"And I want to know how to script on javascript" Dose this mean that you have no clue how to script or that you want the code in Javascript? If you have no clue how to script look up some tutorials :)
Actually I have see the hack and slash Rpg tutorial, but it is using c#...I want to know how to change into javascript. Or other tutorial suggest?
Is your attack area spherical? If so, you can simply check for distance, or you can create a mesh sphere with no renderer (therefore invisible) and a sphere collider that has isTrigger set. That way you keep your player collider but gain a spherical trigger.
Answer by CursedOne · Apr 11, 2011 at 06:13 PM
http://www.burgzergarcade.com/hack-slash-rpg-unity3d-game-engine-tutorial
go from 3 - 7 :) that gives a basic enemy AI and melee attacking scripts but these are in c#