So this may be a silly question but here I go. I have 3 characters that share the same physics and collision (raytrace based, manual movement via “Set Actor Location” node). I have setup my base class which is a child of Pawn. It has some components that handle character rotation, and every physics related variables (speed, acceleration, etc) and an empty Skeletal Mesh component. Then I create the Blueprints that inherit from my base class and set the skeletal meshes via Construction Script.
The problem is that when I spawn and possess any of my characters, they don’t move at all since the physics and movement logic is in the base class’ Event Graph. I thought that they would inherit their parent’s transform as well as components, functions and variables. Does every character have to contain a copy of my base pawn’s code? I made it this way specifically to avoid that.
Am I missing something? Thanks for your help.
Alright, kind of got it. I moved the collision and physics code to my Player Controller and cast to my base pawn class to modify its variables and call its functions. It affects any of its children (characters) that is possessed by my Player Controller class.
Now the question is, is it okay to use cast once per tick? It doesn’t seem to affect performance but I get the feeling that it’s kind of sloppy.