![]() ![]() You could also check to see if the character is playing the right anim.Įasy to set up and expand to new weapons. Filter out anything that's not the weapon, as well as self-collisions (weapon hitting the player). Put an OnCollisionEnter function in your player script. Stick a collider on your weapon, and have a swing or attack animation. If the hit collider is something that you can damage- then it's pretty straight forward.īut that's just me, I'd be curious to see what ideas you all have or tips from people who have already worked on melee systems before. Meaning, when a character attacks you'd check a set distance in front of you with a raycast, and return what was hit. The method that I feel like would work better though is distance checking, or raycasting. ![]() If you're swinging something like a sword then you could possibly trigger a hit at the onset of your swing animation when, arguably, there shouldn't be any force behind the swing. The first is to check and see if a hit (melee strike) has connected with a specific collider? To me, that sounds like a fairly unreliable system that has to take a lot of things into account. When I think about it though I usually come up with two different solutions. This has been something I have been thinking about for a while, but haven't had a good reason to build yet.īut it just feels like there's a ton of different ways to go about it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |