How to make a sword collision?

I’m trying to learn how to make a melee tour colission without using tags for a network game, I been asking for help but no one seems to respond. I searched all the post and it doesn’t seems to work using the scripts that people use.

Do you have a branch of code?

all i have is just me switching between the on trigger enter , applying damage to the objects but i happen to have a lot of collision problems, physics.ignore collision doesn’t seem to work very well or not even register the code correctly, even if i just do a on collider hit function and etc… i can’t use a gameobject.tag since it’s a networked game meaning a free for all, i pretty much have a fps networked but it’s more like a 2d version of it similar to metal slug and or contra, i added a collider to the knife object for the melee such as even like i said before making it a trigger and i do get the damage sent but since the knife it’s coming out of the models pocket the player pretty much suicides himself, even if i don’t use the knife key in which later on i’m probably going to have a if statement in which somehow i need to calculate where in the animation this should be working in which i’m still trying to figure out, by just walking to my oponent the knife kills him too. i can’t use tags because we are both players in the network and the ignore collision code just turns of the damage for me and the enemy player.

i been searching around the threads and post but most of those codes and or scripts don’t work for me and yes i did check for grammar errors and logic too but unity doesn’t take those arguments i seem to have a lot more problems when it’s on a network.

my option i’m looking for would be the layer collision, honestly i don’t understand it and i don’t get how it is being used, the reference manual it’s not descriptive enough.

lol that’s hilarious.

Unity has a scripting language for people to write what THEY specifically need. O_o People can try to help by posting scripts but ultimately if it doesn’t work like you want then you have to write something that does. :stuck_out_tongue:

Only activate the trigger while player is attacking.
Sorry if it was mentioned, but it hurts my eyes to read walls of text without punctuation or paragraphs.

now i would probably need is to somehow being able to enable the script at a certain point in the animation. do you know any ways i should use? could you please guide me in the right direction.

i understand that i have grammar problems since english is my second language if you want to you should help me with my english classes since you seem to be smart about it.

Look up Animation events in the documentation.

hi, look at this topic
im going to make a sword game but it seems very hard

http://forum.unity3d.com/threads/82774-How-to-make-a-sword-collision

I went about it a different way and just curious as to why you want the actual collision(good to hear other peoples ideas). But I basically just check the distance and wether or not the player is facing the enemy and then do all my calculations based on that such as hit chance and damage.

ok the reason why use collisions in because it’s a networked game, i still haven’t been able to solve the problem. i’m in need of help, i tried doing the whole thing about activating the script during a certain part of the animation, using layer but it still not reconize them and i can’t use tags, if i use a ray cast it might not help since most of the time you need a tag or some way to get the other player information, if i use a player tag for example me and the networked player we both have the player tag, so it won’t coexist.

i tried getting the information of the players in the network so for example once i spawn whether it’s server or client we all become the player(clone). i tried using that during a script but still no solution since each spawned character will have the same name.