A player form change system?

Godot Version

v4.7.2.stable.arch_linux [ed1daf0bf]

Question

Hi!

Forgive me for being brand new to this. I’ve been following a really good guide on the type and using some placeholders from spriter’s resource I’m in the early stages of a working prototype. I can move around a city block and break TVs and I might be getting way ahead of myself but I’m inspired!!!

I really want to make this into a werewolf game and I’m not sure how I should be handling the form changes.

So far I have a Scene created called Player and an Inherited Scene for each form - that is Human and Wolf. The different forms should have distinct:

-Sprites and Animations

-Hit Boxes

-Damage Boxes

-One Unique Action (a hadouken in human form and a grapple in wolf form)

-eventually Skill trees that modify stats in either form

I had the idea to do something like this:

enum Forms{HUMAN,WOLF}

func form_handling() -> void:
	if forms == Forms.HUMAN
		
	elif forms == Forms.WOLF
		

My first thought was to add it to the player.gd script, with a line under each IF statement telling it which child node should be active. But I’m not sure about the syntax for any of that.

My second thought is to add it to a more global script, spawn both forms in the level on top of each other, and just have whichever form is inactive switched to disabled and hidden.

Any thoughts would be appreciated!

Hi and welcome I guess.

This screams state machine and there is a tutorial in the docs: State design pattern — Godot Engine (3.2) documentation in English
In it there is persistent_state.gd which removes and adds the relevant child but en/disabling them will work just as fine.