How to change the direction of my pawn with the camera direction

Hello everyone, I am making my first game, I followed some tutorials and I decided to make it simple: A sphere that moves with torque. (by hideo kojima)

My sphere (a pawn) moves in the right direction, the camera is good, but I try to make it so that when the camera looks, for example, behind me, the sphere changes direction and moves backwards even if i keep pressing the “w” key.

I don’t know if I’m making myself understood but basically I’m trying to replicate Hammond’s gameplay in Overwatch if you’ve ever played with that thicc boy.

I saw that the character movement component like “orient rotation to movement” could help me accomplish this but I’m a pawn, so I don’t have that component and making my sphere a character isn’t weird since I’m just a sphere?

So I tried to fiddle with it, but I can’t get “orient rotation to movement” to work with my sphere even if I make it a character, so i got back to a pawn. I’m of course missing the obvious, I would appreciate a lantern from a charming traveler to light my cave.

This is my ball movement

This is my camera movement

What the prototype looks like

1 Like

Use Right Vector to roll a ball with torque in the direction it’s facing. Or the right vector of the camera if you want to roll it along that way.


The way it’s set up right now, you’re using world direction.

1 Like

Thank you for your reply king, so i have tried to follow your advice with the help of this video ==> WTF Is? Get Right Vector in Unreal Engine 4 ( UE4 ) - YouTube and other topic on this forum.

My code now:

I dont think its the right way but i managed to get something. I checked ‘Use Controller Rotation Yaw’ on my BP_Ball,

If I look exactly behind me, i can press ‘w’ to go in the direction the camera is facing. Great. But if i still look behind and slightly to the side, the ball is following the right vector [in red] (i presume ?) and not really the direction my camera is facing [in blue]

I kinda want it to act like this character on this game: 49 ELIMS! 18K DMG! HARBLEU HAMMOND GAMEPLAY OVERWATCH SEASON 35 TOP 500 - YouTube

I think i missed your point @Everynone

You’re not using the right vector correctly. Use the entire vector. And use the vector of the camera, not the vector of the ball.

The ball is rolling so its right vector is all over the place unless you unrotate the transform.

Example using Right of the springarm:


Also, it may be difficult to replicate this movement with torque only, you may need to add impulses as well (or instead!) and / or set up physical materials to boot. Check this excellent post out:

1 Like

Thanks a lot, managed to get it working following the second video you posted + adding force is more the feeling i was looking for, have a nice day king