I’m wondering which class would be best suited as a base class for Creatures (for example bears or wolves), the Pawn class or the Character class?
The documentation (Unreal Architecture | Unreal Engine Documentation) specifically says that a Character is a humanoid-style Pawn with the CapsuleComponent and the CharacterMovementComponent by default. It would probably be difficult to fit most creatures in the CapsuleComponent (especially since I’ve seen various parts of the engine’s code expect it to be oriented vertically so I can’t rotate it in order to better fit a non-humanoid style creature like a bear)… so that makes me think the Pawn class would be better. But are those 2 (the Capsule and CharacterMovement Components) the only differences between Pawn and Character? And if so, how could I easily re-create similar functionality for Creatures (I suppose I’d still want a collision shape and a movement component for the Creatures)?
Or is there an easy way to change the Character class to also work correctly for non-humanoid-shaped Creatures? Humans and Creatures in my project should otherwise have very similar functionality (both have an inventory, both would have similar AI, similar stats, etc.) so I would prefer a common base class for the two.
Hey there! For bears or wolves, I would personally go with the Character class myself. You can always ignore the capsule component when you are doing your collisions and specify your own bounding box/sphere/mesh/etc. The movement you can derive from the source code itself. Typically, the way it works is that you have an input binding that tells either the actor directly or the controller that you want to apply an acceleration vector in a certain direction. Then the controller tells the actor how to process that input vector using the actor’s functions. Without the controller, the actor/pawn/character won’t do anything.
I allways use Character class , as it already has charactermovementcomponent, mesh, and physics, wich is fine for most. Definitely replacing what base Pawn class was in UDK. Becouse on the very basic Pawn class there is little stuff, i prefer Creature.
Alright thanks, I suppose the best way to go for Creatures then is creating a subclass of my own Character class (I already subclassed Unreal’s Character class for my own humanoids), and have that class replace the default Capsule Component with some other primitive.