I’m quite new to Unreal Engine, so sorry if I have made any obvious mistakes.
TLDR: Pawn with FloatingPawnMovement which has box collision and physics is getting stuck on the ground. Character does not seem to be appropriate for what I am creating. Movement components are necessary for AI movement from my understanding. I’m unsure what the correct approach is.
I want to create a simple non-wheeled vehicle with box collision. From my understanding, making this using Character would force me to use capsule collision. It also wouldn’t make sense as this is not a human-like vertically-oriented player.
My current setup is a Pawn with FloatingPawnMovement which has collision enabled with the Pawn preset, and Simulate Physics enabled. Everything works perfectly, however, once the box collision bounces a few times and settles on the ground (whether BSP or static mesh), it gets stuck.
Screenshot 1: Current setup. Root is a box collision component.
Screenshot 2: Movement setup with FloatingPawnMovement.
-
Once stuck, no amount of movement speed is able to move the Pawn. I’ve tried setting extremely high values with no success.
-
Using Sphere and Capsule collision do not produce these results (I presume this is because these collision shapes touch the ground at one point).
-
Using AddActorLocalOffset does work, if Sweep is not enabled. (This might be where the movement is failing). However, I want to be using a movement component. From my understanding, this is necessary for AI movement. Using physics velocities seems like the incorrect solution.
-
Setting velocity using SetPhysicsLinearVelocity does work however I’m unsure how good of an idea it is to use this for player movement. Again, I’m pretty sure that using a movement component is needed for AI.
-
My first thought was that friction was possibly preventing movement. However using the Physical Material attached below didn’t have any effect.
-
Interestingly, if using an actor with box collision as the ground rather than BSP or a static mesh, the Pawn does not get stuck and moves as expected.
Screenshot 3: Frictionless Physical Material.
I would like to simulate physics because I need the vehicle to have gravity and to rotate correctly when driving up a ramp, etc.
Although I have posted this in Blueprint Scripting, if C++ programing is necessary, I can work with that too. All suggestions are welcome.