I am making a 3D side platformer. The player (character class) is a cube and I would like the cube to follow the shape of the terrain and still be able to control the cube. Something like this:
Enable “Simulate physics” on the static mesh (MeshComp), but it causes the cube to ‘detach’ from my character. The cube respects the physics, but does not move by key presses anymore. (I can only control an invisible entity and push the cube around)
Stick the CapsuleComponent and the static mesh together using a PhysicsConstraint and adjust its properties.
Wrapping CapsuleComponent inside a PhysicsConstraint to affect all children.
Remove the default SkeletalMeshComponent
These didn’t seem to work. Do you guys have an idea on how I could make it work?
The thing at the bottom that says CharacterMovement, that’s non-physics based movement. If you want physics based movement, you’re going to have to create a blank pawn and code it yourself from scratch.
Okay so now I’ve recreated my character from a fresh Pawn subclass. Do I need to enable physics and gravity on any of my components or do I need to code the collision and physics in order to calculate to cube’s rotation?
When I enable physics, collisions work but I lose control of the cube.
yes you need to simulate physics on the Mesh Component.
This is the part where you have to code the movement yourself. If you right click and uncheck ‘Context Sensitive’ and scroll down to Physics, you will see all the options they’ve given you.
If you don’t want your cube to spin wildly, in the mesh details find “Max Angular Velocity”, check that box and set it equal to zero.