Topic: Adding weapons to character

Hello everyone, need some dire help. I have a character I bought that is holding weapons, however they are no bones attached to the weapon. Can someone please tell me how I can add hitboxes to the weapon so it moves with the motion. I tried couple of things and it seems like I am missing something. Please help

Share

Thumbs up Thumbs down

Re: Adding weapons to character

Hi, I've added hit boxes by simply adding empty gameobjects to the weapon hierarchy. It does not need to target bones per se, just transforms.  For a sword I actually use two extra gameobjects and hit boxes to run the length of the sword. Works great. I have a tutorial that shows how I set up weapons...

http://www.ufe3d.com/forum/viewtopic.php?id=883

Share

Thumbs up Thumbs down

3 (edited by bm_farooqui 2017-11-04 13:33:43)

Re: Adding weapons to character

Hi Chris, it worked thanks!


Also, while you are here another problem, just a newbie question, so if I put the hitbox sphere far from character and when I play the punch I was expected it to hit the enemy, but it doesn't do that? I have to be really close to the enemy to be able to make a hit. am I missing something here too? I really appreciate all the help!

Share

Thumbs up Thumbs down

4 (edited by christougher 2017-11-05 10:26:18)

Re: Adding weapons to character

Something isn't right.  I'd say pay close attention to the animation when you preview it in the move file.   It should show you exactly where the targeted hitbox is at the target frame as well as change color to demonstrate it's active.  Make sure your are targeting the correct hit box.  Someone else just posted the same question and had targeted the wrong hand.  Double check, but the ability to preview the anim in the move editor window is a godsend for debugging this sort of thing.

Share

Thumbs up Thumbs down

5 (edited by MrPonton 2017-11-05 11:32:15)

Re: Adding weapons to character

While yeah, placing the box on the wrong hand could be the issue.

You can verify by initiating the move, pausing Unity, then step framing while watching the hitboxes.

It should also be noted that you might be having an existing issue. The animation that plays out can most typically be 0-3 frames faster than the hitboxes. I've been told that this is due to the "preview" of the character/move being a "preview" and not an in-game editor. I was never able to figure out the cause of this delay, as it was different across various moves for me. Some would be 0 frames difference, others would be 2 frames delayed.

So how does that affect you? Well... consider you have an animation that in a single frame the left fist goes from character's side to 3m in front of the character, then the next frame is returned back to the character's side. Now, consider you set up the frame data of the move/attack to turn on in that frame it's 3m away. However, in the game the animation is delayed though the hitboxes aren't. So you'll see the hitbox turn on while the fist is to the character's side, then a frame or two later you'll see the 3m distance frame of animation but the hitbox is already turned back off. This can give the perception that the character is "missing".

Long story short, I've never been able to figure out WHY this happens or HOW to fix it.  My assumption is that it's the system taking a few frames to locate which animation of the move to play, load it, potentially adjust the animation for Mecanim though i'm unsure if this issue occurs during Legacy, calculate how fast to play it, and then begin playing. The best thing I did to mitigate this was to either guess and check each move's hitboxes in-game, or to link all hitboxes based off of root position, or an area that doesn't animate with the character. I broke the connection between hitbox and animation. Now, my hitboxes appear in the positions I want at the frames I want them to be at. As you might have noticed if this issue is what you're getting, you won't notice a 1-3 frame offset in animation from the hitbox.

Share

Thumbs up Thumbs down