Godot Version
4.3
Question
I’m studying and working on a local multiplayer game and could use some(alot) advice to improve my implementation.
If you’d like to see more of the code, the repository is available here: godot-learn-multiplayer. If you happen to check it out, I’d greatly appreciate any tips, suggestions, or constructive criticism you can offer! The more feedback I get, the better I can grow as a developer. Your insights are more than welcome—thank you in advance!
Here’s my current setup:
- Characters: Using the Dino Character - (itch-io | dino-characters)
- AnimatedSprite2D node for sprite sheet and animations.
- Input Manager: Leveraging Matjlars’ MultiplayerInput addon for handling player-specific inputs and devices.
- State Machine: Using a Finite State Machine (FSM) for dino animations and behaviors.
- Input Requirement: The game requires joypads only for input.
For my player setup:
- Each player character uses an
AnimatedSprite2D
for the dino animations. Currently, I have fourAnimatedSprite2D
nodes, each holding different dino animations. - To change the player’s skin, I reassign the
AnimatedSprite2D
node reference to a central variable animator. This seems to work, but I’m running into issues.
Problems:
- Skin Changing Approach: Is reassigning
AnimatedSprite2D
nodes to a central variable a good way to handle skin changes? It feels clunky and potentially error-prone. - Animation Stops: After switching the
AnimatedSprite2D
node for skin changes, only the “Idle” animation continues to play, while other programmed animations stop. - Repeated State Entry: Pressing the Attack button causes the player to re-enter the Attack state multiple times.
For context:
Matjlars’ addon simplifies input mapping for multiplayer, so I don’t have to create separate maps like move_left1
, move_left2
, etc. It simply adjusts inputs based on the triggering device.