Physics Player Pawn Movement

Hello everyone! Apologies if this has been touched before, but I haven’t been able to find my exact issue yet. If so, please link away!

I’m running through a tutorial and the player pawn is a simple sphere with physics applied. Movement is achieve by adding torque to the x and y axis. All is well for a fixed overhead camera… but I would like to modify things by allowing camera movement. The camera movement isn’t the issue yet. I’m able to modify that to my liking, but getting the pawn to move as I would expect is another issue all together.

For instance: If the camera is behind the pawn and everything is oriented like a map and I press forward (north on the map) the pawn moves forward and toward the north. Great!.. but when I swing the camera around to see behind (now the camera is in front of the pawn) and I press forward the pawn moves like it’s supposed to… north! (not like I want it to)

I’ve tried a slew of simple fixes and world vs relative rotation has been at the heart of most of it. It would be great if I could use the camera as the parent and “steer” the pawns z axis, but physics seems to not like that so much.

I would be very appreciative of any ideas, suggestions, etc.

Thanks a ton!

So basically you want the pawn to move in the direction the camera is facing?

What’s your camera and boom set up?

I’ll go into more detail, but unfortunately I really don’t know what’s relevant and what’s not. I have a physics sphere that’s driven by the torque on the x,y axis. The player pawn blueprint shows the rt/lt camera movement. I haven’t set anything else up on the camera other than what you see on the left. Very simple setup for now. I just can’t seem to “steer” the pawn with the methods I’ve used, which included trying to make the sphere a child of another actor. That’s when physics wouldn’t work, of course.

So, thinking about this a little more, here’s what I would like to do: I would “like” to be able to pivot the local coordinates (I believe Unreal calls it relative) around the z axis. When I try to do this though (whatever method I use) either makes it to where I can’t move the object at all or it just kinda quivers and moves erratically. If I could do that, then my keys would still be applying torque to the correct axis. Any ideas for turning the local z axis without interfering with a physics setup?

Now that I ask that, I’m thinking that might not be the right approach anyway. My keys for applying torque are set to the world coordinates aren’t they? Hmmm…
When I get home, I’ll post a shot of the BP for the torque. I’ve tried to see if I can apply that to local before, but didn’t make any progress.

On movement input -> compare camera rotation against marble rotation (YAW, Z axis). If different rotate marble to match camera…Yaw only. Then apply torque.

Essentially make the marble face the same direction as the camera before you apply movement. Setting world rotation on the marble is going to snap rotate it. If the camera is facing south and marble north, then on movement input the marble will rotate instantly to face south.

Sweet! Thank you… I’ll give it a shot asap!

So, I figured out (a little late here) that the 3rd person template does exactly what I want. Now all I have to do is figure out how it does what it does, I guess. The problem for me is that it uses a character BP and I’m not. In the end, it’s just a lack of knowledge and experience on my part. I’ll continue tearing it apart but in the mean time if there’s any thoughts on implementing the 3rd person template movement/camera setup to a physics pawn (not a character) I would love to hear it.

Third person template uses the Character Movement Component. Start there.

I’ve been wrestling with it. I think the problem I’m having is figuring out what the differences are in Character Movement vs Default Player Pawn movement. My pawn isn’t a “Character” and I don’t have Character Movement Component to work with. The movement of the pawn is by rotating the x and y with torque. I know this could be changed, but I do like the way this works and would like to try to keep it, if possible.

I’m trying to do something similar and can’t figure it out. I have a physics ball (pawn) that’s controlled with torque. I’m rotating it on the Z axis to turn it but that only seems to affect it on the local axis, not the world axis, this means that even though it rotates the pawn always faces the same direction.
Let me know how you get on.

Cheers

So, I found this article and it seems like they (the author and team) have found a pretty good solution. I sent him an e-mail and he seemed like he would be willing to help point me in the right direction. Not sure when that will be, but for now I’m trying to decipher the article. Gamasutra: Nathaniel Ferguson's Blog - Rolling a Ball: Harder Than You Thought (part 1)