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.
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]
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:
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