Hi guys, in my next game I wanna do something like this video…That was UE3. This is better than a boxcollider or a mesh collider, because it's not posible jumping the collision when the animation is really fast. I'm not asking the source code of something like this, (if exist an asset, great =P ). I tried to do that but the problem is calculate the position where the ray born when the mesh is animating. Any idea?
Hope this help
Do not cast the Ray always, only when the character is attacking, then once per frame (update() or similar) cast the ray, and cast it from the point of the spear or the part of the weapon that suppose to hit the other character, cast in with direction forward relative to the hit area of the weapon.
Probably you will need to add a dummy GameObject in the hit area of the weapon pointing forward, and you will raycast from there.
Maybe you will want to set an event in the animation and start raycasting when you are hitting and not charging.
Hope this help.