Godot Version
4.4.1
Question
I have been programming for decades now, but just started with godot and game developent. So I hope this is some simple task, where I just miss a setting.
I have created a simple game with a player (new scene character3d) that always moves forward and can only move up or down. It can collide with a floor, trees and other objects because of the collisionshapes I added.
This is working as it should and all movement logic has been built in an attached script on the player.
But now I want to have a character selection, where you can be either a male or female, with different dimensions, but the same movement.
So I made a new player_wrapper scene (character3d) and added all the movement there. Then I added the old player to this scene as a child. The old player has collision boxes, the wrapper doesnt (because they change based on the player).
Visually it works and movement works at first, but not when there is a collision.
When colliding the player_wrapper doesnt hit anything and keeps moving forward, and inside the wrapper the actual player is stuck behind the object and moves.
Basically the player starts at 0,0 in the wrapper and after a collision the player moves to e.g. -50,0 and after that things become strange obviously, because rotation is skewed.
Is there anyway to uses the players collisionboxes on the wrapper as well?
Somebody suggested changing the player to a collisionshape3d instead of character3d, but that didnt add collision to the wrapper. Maybe it need something else?
Or I could update player position in pshysics bacl to 0,0 but that feels a little hackish.
What would be the proper way to have one movement object and different objects inside? Let’s say a base car class with logic and then a Ferrari, Lamborgini and Hummer scene inside.