Godot Version
4.2
Question
Hi, sorry to bother, to give some context I have some knowledge in programming however it is the first time I am using Godot as a whole and so my knowledge regarding nodes, animation, and conventions when it comes to structure is lacking.
As it is right now, I have made a system to God of war (2018) where my player would have loadouts
, each comprising of 1 Weapon + 3 abilities. Abilities can be weapon specific or general use ( magic etc… )
For a simplified rundown:
- WeaponType is a resource with an ID, name, and a packed scene export.
- Weapons is another resource with an ID, texture, a weaponType, and some stats.
- Abilities are similarly resource with an ID, but they can also have an optional WeaponType
Currently, I can equip those weapons and abilities and switch between them just fine.
The issue that I have now is simply node structure and animation.
The way that I am currently going right now is in my player scene to have a WeaponManager
scene. This manager listens to equip
signal and spawns a weaponType.scene based on what type of weapon is currently equipped.
Each WeaponType.scene is comprised of a Sprite2D, collision box, and an animation player, and has other things like combo information ( counter, timers etc… ). So essentially anytime a weapon is equipped, the scene’s texture changes to the weapon itself ( there are currently no collision shape changes within same weapon type ), and no behavior change other than that. When collision hits an enemy, an _on_weapon_hit event is emitted with the weapon’s properties.
Now, my issue is that I am not sure whether that’s the best way to achieve my goal.
I can see potential pitfalls with the system like maybe having to trigger two animations ( one for the player, one for the weapon ) depending on the attack or ability. Or previewing the final animation/product in the editor. Or having too much communication between WeaponManager and player classes.
So my question ultimately comes down to: Am I overthinking? Is there a better way to handle this? Am I possibly going to run into issues?
TL;DR: I have a loadout switching model but unsure how to apply it with Nodes, textures, collision,