2
\$\begingroup\$

I would like to create a boss but first, I want the player to fight the head. Then the head flies to the body and becomes attached to it.

Later, the boss will throw an arm to the player and the arm will chase the player, becoming independent with its own AI.

Do I have to render 3 models separatly? (The head + one arm + the body)
If I do this, how am I supposed to animate the complete body when everything is attached together?

Do I have to render the 3 models (The head + one arm + the body) + 1 model without the arm (Head + body) + 1 model with everything attached?
If so, how do I handle animations with these 5 models?

\$\endgroup\$
5
\$\begingroup\$

Remember, just because two things look the same or logically are the same in your game's fiction, does not mean they need to be the same entity in your game's implementation.

Here you can have one model that is your boss as a whole, that you can animate as one complete being. Using submeshes or vertex colours, you can split parts of it to render only selectively: replacing the material for one submesh with a transparent pixel, or cliping it out of existence in your shader based on a uniform variable.

This lets you have one animated body, with pieces you can hide on demand. (Just be sure the torso's neck/shoulder are capped, so you don't see inside the hollow model when the head/arm are hidden)

You can similarly disable the colliders for these body parts, or shunt them to a non-colliding layer when the body parts are absent.

In the same frame that you hide the head part of the main mesh, you spawn (or reveal/enable) a standalone head object at the same place, which can then separate and start doing its own thing.

Then when you want to re-attach it, you can have it fly back to the position of the head bone, then hide itself / re-enable the full body's hidden head in the same frame. A brief flash of particle effects can help hide the transition if you have trouble getting it completely seamless.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.