Hi so I’m aware that you can’t change the default character capsule component but what I would like is to have all the collision functionality in a separate class to avoid decoupling and have my actual character just be a bunch of components. Does anyone know how I can achieve this as I can’t change the default capsule component? Thank you and any help is much appreciated
The built-in Character Pawn and Controller classes are tightly coupled. That’s just the way it is – character movement, especially in a fast simulated first-person-shooter game, is a highly specialized task where the performance and control gain of the coupling can outweigh the benefits of a less coupled design.
If you want things to be more separate, you can subclass Pawn instead of Character, and subclass PlayerController instead of CharacterController, and build your own componentized version of a character setup. Beware, though, that there are many, many, tweaks inherent in the Unreal Character setup that you won’t benefit from in a new controller/simulation combo, and you’d have to come up with your own solutions for those problems. The main reason to do this would be if you want a “fully physical” simulation, driven by forces and torques, rather than the special simulation inherent in the character pawn.
Okay, thank you for the information, so should I just put most of my collision related code in my main character class as I wouldn’t fancy creating a new character setup?
If you want to change collision handling, you may need to either fork the C++ character class, or build your own that derives from Pawn.
It’s possible to add some additional collision handling on top of the existing one, but there will be limitations to how far you can push that model.