Pawn with subcomponents holding meshes and logic
I started porting my helicopter flight simulator to UE. I just came across some best practice issues.
My Helicopter should be of type Pawn. Next I want to add sub-components such as rotor and rotorblades. I'm a little bit confused, which type of C++ sub-component to use. I want to achieve, that each sub-component may hold a static mesh (in case of the component for rotorblades) and it's assigned logic. In this way, all logic will be part of the component that is responsible for it.
Final result should be, that a rotor is attached as subcomponent to the helicopter pawn. A rotor itself consists of multiple rotorblades attached as subcomponents to it, which should be represented by some physics and it's designated geometry.
The helicopter pawn will receive the joystick input and pass it to the sub-components for the physics calculations.
asked Aug 01 '18 at 01:19 PM in C++ Programming
You can check for more suitable candidates from the links provided.
Happy coding :)
I think you are missing the point of the component based decoupling pattern. One of the main reasons for components to even exist is to separate the gameplay logic from the mesh (rendering) and physics. This maintains "locality of reference" in order for your game to take advantage of the CPU cache.
There is a great book on Game Programming Patterns from Robert Nystrom which might provide more insight on game engine architecture.
Follow this question
Once you sign in you will be able to subscribe for any updates here