• Godot Help
  • Need tips for structuring a Character Scene in regards to Animations

Hello everyone! I'm still fairly new to Godot and i'm putting together a prototype for a 3D, 3rd person action brawler.

The player can select a character, each with its own model and animations (they're fairly simple models) and a melee weapon (like a sword, hammer, etc).
The models and their animations are made in Blender and imported to Godot as .glb.

My idea early on was to structure the player scene like so:

. PlayerCharacter (KinematicBody3D)
.... Body (Spatial3D)
........ Model (MeshInstance) This would be the character model
........ AnimationPlayer (AnimationPlayer) Contains all animations for the model
.... Weapon (Spatial3D)
........ Model (MeshInstance) This would be the weapon model
........ AnimationPlayer (AnimationPlayer) Contains all animations for the model
.... AnimationTree (AnimationTree) Controls all animations
There would be other nodes but i don't think they are relevant to my question.

The idea is to switch Model and Animation within Weapon and Body nodes when the player switches bodies or weapons and keep the same scene structure.

With this approach, i have a question:
The AnimationTree node can only be assigned to a single AnimationPlayer. Should i have 2 different AnimTrees, one for each model?

But also, do you have any advice on how to structure the scene? Any notes to give?

Any general advice would also be appreciated!

    Cabeza
    Hello,

    I don't think you'd need animationTree for weapon unless the weapon itself contains complex animations (like a futuristic shape shifting gun or something). For regular gun you could just use animationPlayer for animations like reload/recoil.

    You would attach weapon to your player using Bone Attachment then do some codes to swap them around.

    For player selection you could have each player on their own scene/AnimationTree or use the same scene/AnimationTree but swap the body mesh. I've never done it but you might find this link helpful.
    https://godotforums.org/d/26026-how-to-correctly-swap-the-mesh-of-a-meshinstance-when-it-s-also-parented-to-a-skeleton-node

      Gowydot …or use the same rig but swap the body mesh.

      This can be done only if different models (meshes) have the same rig.