mo
New vMember
Posts: 3
|
Post by mo on Mar 25, 2017 23:04:02 GMT
When I try to add a weapon to my character (The way the tutorial showed) it shows up in the melee manager as in his right hand but the attack style is still the unarmed attack. Example: The axe was linked to the right hand but the character was still punching and kicking as though he was unarmed.
Any ideas on how to remedy this? I am thinking it is simple but I haven't been able to work it out yet.
|
|
|
Post by G 4 greatness on Mar 26, 2017 0:56:30 GMT
does the weapon have an attack id set?
|
|
|
Post by uberwiggett on Mar 26, 2017 2:04:04 GMT
Mo, is that the old version of the tutorial? I believe there was a stage when you could drag and drop in the hierarchy and it will instantly appear on your player. This still works for NPCs but not for players. If you are using the Inventory then you will need to equip it via the player's inventory script.
|
|
mo
New vMember
Posts: 3
|
Post by mo on Mar 26, 2017 21:32:37 GMT
Thanks so much for the answers. I changed the attack id from 0 to 1 and now the character is using the melee weapon to attack and the tutorial I watched was from 4 months ago.
|
|
mo
New vMember
Posts: 3
|
Post by mo on Mar 26, 2017 22:55:07 GMT
--FIXED-- I've got another quick question. So the weapon is working with my character but the hitbox of the weapon (long sword) is not hitting the enemies. It seems like it is still using the arm and leg hitboxes instead of the sword's hitbox. Does that make sense? I noticed this cause if I got close enough to the enemy my last attack in the chain (Attack C in the original animations) would hit in the same way a punch would. I haven't altered any animations or weapon properties other than resizing the weapon hitbox to fit the weapon properly. Any ideas?
Sorry for the "Quick Question". If I need to ask this somewhere else I can. Thanks for any and all responses.
|
|
|
Post by G 4 greatness on Mar 28, 2017 17:21:08 GMT
set weapon hitboxes in the create melee weapon tutorials
|
|
|
Post by shadex on Mar 28, 2017 19:53:34 GMT
--FIXED-- I've got another quick question. So the weapon is working with my character but the hitbox of the weapon (long sword) is not hitting the enemies. It seems like it is still using the arm and leg hitboxes instead of the sword's hitbox. Does that make sense? I noticed this cause if I got close enough to the enemy my last attack in the chain (Attack C in the original animations) would hit in the same way a punch would. I haven't altered any animations or weapon properties other than resizing the weapon hitbox to fit the weapon properly. Any ideas? Sorry for the "Quick Question". If I need to ask this somewhere else I can. Thanks for any and all responses. Well, easiest way to check for me personally is to see if the hitbox is actually there at run time. 1. hit play (not in maximized / fullscreen mode) 2. Start a swing animation and immediately pause it (or click on the attack trigger in the animator while its paused) 3. Hit the button to the right of the pause button to have the game play a frame each time you click it 4. In scene view, watch the for the hitbox to appear in the animation. So if it's working, and the start / end time in the animator are configured correctly, you will see the hitbox turn on and off again at the end of the animation. You can see the size and everything. So what i'm guessing is wrong (if the yellow hitbox is not present) is that the order got switched around for whatever reason (reimport problems?) on the hitbox of the weapon itself. The proper order is Transform, Box Collider, v Hit Box (Script). If the script comes before the collider it wont work. Also the other problem it might be is on a reimport unity has a bug that strips animator scripts. If that's the case, go to animator -> fullbody -> attacks -> WeakAttacks -> sword (or whatever your calling it) and check on each of the animations for that weapon and ensure that "v Melee Attack Control Script" is on there. Either way, both have happened to me, and assuming everything is setup correctly (melee manager and all) then this is the next likely scenerio.
|
|