Unable to move pawn

I am trying to move a class that derives from APawn. I am getting the movement component of it in script and setting the velocity of it after adding a bit of force. The values going into Set Velocity are correct, but next frame when I Get Velocity, it is still at zero.

I’ve tried with Simulate Physics and Start Awake on. The “Mass in KG” is set to Zero, but grayed out so I can’t edit it. Ideally I’d like to Add Force or Add Force at Point to my Pawn, but I can’t seem to figure out how to do that either.

Does anyone have any ideas?

Thanks!

Picking from these answers.

It says you may not be able to set Mass in KG without having collision over the object. I’ve used Set Velocity with success but AddForce is slightly more interact. I would suggest looking at the Content Example, Level Blueprint_Input_Examples for applied linear physics in the UFO Blueprint. I don’t have an example with AddForce that I can find.

If you are using APawn, there is no default movement component, unless you have added one. Just want to make sure that is out of the way first. You may consider trying what you’re doing on Character first to rule that out.

Secondly, are you trying to add physics velocity or velocity to the movement component? If simulating physics, any movement component stuff is usually ignored, and you are committing to using physics for movement and simulation.

The UFO blueprint is similar to what I have working now. Though it suffers from the same issue that my pawn has, which is when the capsule hits a wall the friction causes it to spin. I haven’t been able to figure out how to turn off friction on it.

Oh okay, so that’s the problem you’re having. I created a ship in another game and I found a solution that works for me. There may be settings to do such, but this is what I have done and It may possibly work for you. What I do is limit the rotation of the object by flagging the rotation once a certain limit is passed then gradually update its rotation with Rinterp To prevent flipping.

It’s one of the roadblocks I’ve run into. I’ve been trying a bunch of different ways to obtain the desired effect (swimming). Does your network just clamp the absolute world rotation? Or does it limit the max angular rotation to prevent fast spinning?

This one just clamps the rotation. The Rinterp To just makes the change look more pleasing rather than immediately clamping it.

Hey Heisenburger,

I found a way to avoid clamping and that whole solution. If you go to your Mesh Component and push the arrow down under Physics. The value Angular Damping will help return your mesh back to a balanced state. I’ll let you know if I figure anything else about this.

Update:
I also realized that by having my input axis tilt the hover car forward or back, allowed it to go back to a balanced state when no input as given. This may be something to look into, depending how you’re applying movement to your vehicle.

From what I can tell. It needs to be in game for it to calculate the Mass of the object. More likely, its a bug. Even when I check the content examples, their work is the same way. The small rocket in the physics example has no mass within the Blueprint.

I create Player BP from Pawn class and add the static mesh as root component. Mass in KG for mesh equal zero, but if I place this mesh on the scene mass will be greater than zero. And if I apply force to pawn’s mesh, it moves good.

  • Collision geometry exist
  • Density of the PhysicalMaterial applied
  • Mass scale greater than 0

Why in Pawn BP static mesh mass = 0?