Creating A Melee System With Traces Or Collision

Ariakus
Wed, 10 Jun 2015 17:51:52 +0000
Platform & Builds

Greetings!

As topic points,it’s about creating a melee system in (preferably) 3rd person view.During my readings on internet I found two solutions for this.

First one is with traces.When player “attacks” an animation plays for “sword swinging”,and at some point animation fires an event to cast traces to check if it hits something.If it hits then with this information user can run required functions for apply damage or for anything else.

Also if I understood it correct,there is a “Chivaly Medieval Warfare” method,which makes cast traces during the whole swing,not only on a specific time.
Like below:

[Question]Do these two styles of a single method uses sword’s mesh’s location and and forward vector to cast traces (channel)?

Second one is with collisions.As far as I understand,when your sword’s mesh generates hit event when it touches something that is collideable user can use this to apply damage or run other fuctions,or just ignore like if it is a wall.
When I tried this,problems occured.First my sword (with convex collision shape with max hulls and vertices.) is jsut ignoring stuff and goes throught them.But interestingly it doesn’t ignore player’s (my) collision sphere,and preventing my movement.However I managed to fix this issue with holding sword in right way.And this is where I stucked.

[Question]What is the proper way to implement a collision based melee system?

Sorry for the long post.I tried to explain the situation and my experiences as I found many helpful answers on here is written in this way.So I wanted to make this topic a kind of reference for future askers.

Thank you!

3 posts - 1 participant