1
\$\begingroup\$

For an endless runner game such as Subway Surfer, in order to move your character so smoothly in both z-axis and x-axis, which component of the followings is better:

CharacterController or RigidBody?

Can we use both of them together; if so, will it have any effect on the performance of our game?

\$\endgroup\$
  • \$\begingroup\$ The CharacterController already has a built-in RigidBody, if I am not mistaken. \$\endgroup\$ – jgallant Oct 13 '16 at 20:20
  • \$\begingroup\$ Both options may be overkill for your needs. All of the gameplay of a lane-based runner could be handled with an integer representing which "lane" the player is in, and some scalars for their progress along the track/obstacles' progress toward them, and maybe an elevation value if you need multi-tiered play. You might not need interactions with physics forces here. Try breaking down "what problem do I want this component to solve?" versus "what problems does each alternative solve?" \$\endgroup\$ – DMGregory Oct 13 '16 at 22:53
  • \$\begingroup\$ github.com/dgkanatsios/InfiniteRunner3D hopefully what u r looking for \$\endgroup\$ – Muhammad Faizan Khan Oct 14 '16 at 11:55
1
\$\begingroup\$

You can only use one. Use the Character Controller, it will give you fine tune control with fixed speeds. Using a Rigidbody for player control is only useful in special cases.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.