Rigidbody or Transform for Character Movement

Hi everyone,

Just wanted a quick advice, so I’m trying to make an endless runner ‘like subway surfers’. Currently I’m working on making the player movement.
What would you suggest should I use Rigidbody & Add forces to Stick to Ground / Jump / Stomp / Move Forward / Switch Lanes [Both on ground and elevations]
Or is it better (in order to achieve similar movement to subway surfers) to use the character’s transform.position to handle everything mentioned above

Also is okay to use both, so for example can I use gravity offered by Rigidbody so it stays on ground but calculate an arc like projection using player’s transform as jump.

Thanks …

You shouldn’t move a character by changing its transform’s position unless you’re an experienced developer that’s looking to create a character with simpler or more advanced physics.

New developers should use a Character Controller or a rigidbody.

The character controller is generally used for creating simplistic yet responsive characters that don’t have any inertia or momentum. Newer developers also like that the character controller can easily climb steps.

But if you’re okay with a character that has a weighty feel to it then I’d recommend a rigidbody.

1 Like

Understood, thank you

Neither!

This is a “3 lanes” kind of game. The character can switch lanes (instantaneously!) and he can jump. Both are purely animations.

So you only need an int that records what lane the player is on: 0, 1 or 2
If the player is on 1 and presses left, you change the int to 0. The rest is just an animation that lerps the player from one lane to another. Same for jumping, this is also an animation with a short period of ignoring collisions.

Try finding one of the original game’s gameplay videos. The ones we used to play in the 80s, perhaps 90s, on a dedicated handheld device. Lane switching is instant there. Subway surfers is still the same gameplay-wise, just covering up the movement with fancy animations and a shader that gives the impression of curving (there is no actual curvature, it’s merely a visual trick that bends the track respectively the game view based on depth).

Start by implementing the lane switching where the player merely adjust X position between -10, 0 and 10 (for instance). Then try to add transitioning animations to that.