Topic: Cannot paste hitbox scrip between characters?

This is probably not supported but I would like to be able to paste hitboxes script from one character to other character. My characters are using identical rigs. When I start the game the hitboxes spawn at origo (not on top of each other, they are still at the "right" places) and dont move with the character.

Share

Thumbs up Thumbs down

Re: Cannot paste hitbox scrip between characters?

Yeah, this isn't possible as the transform reference cannot be transferred to a new game object.  Basically, you'll be able to copy all the hitboxes and offsets, but the reference to the rig's transform will be lost, even if they share the same name.

With the characters you have already done this to, you just need to open them in Hitbox Setup and drag the transforms into each hitbox.  You might see they look like they have transforms already assigned, but this is a small bug in Unity that happens sometimes - click the transform and it will either error or go null.  At any rate, just start dragging your transforms into each hitbox and save the prefab.

Your best option, instead of trying to copy the hitboxes, is to create a custom auto-rig button and just use that for all your characters.

Share

Thumbs up +1 Thumbs down

Re: Cannot paste hitbox scrip between characters?

Thanks! Yes I ended up in the same conclusion.. I'll take a look at your script.

Share

Thumbs up Thumbs down