0
\$\begingroup\$

So I am seeking to make a Match 3 with an infinite runner element. The match 3 portions are all already totally done, but I'm running into trouble figuring out how to best approach the Runner portion.

I'm not entirely new to Unity, but I'm newer, though I'm not new to programming. This is what the game generally looks like:

enter image description here

(Source)

My problem is I am unsure the best way to do the movement. My immediate thought was, I should have the player run in place, and the world move around him, so that the camera and the match 3 portion don't have to have any movement.

Is there another option that is simple that I'm over looking? Following the player as he moved seems like it would be really weird for the match 3 dots, as the camera is flying off into the X along with the player, and keeping the dots up with them sounds like it would be more trouble than its worth.

Any help is appreciated, thanks!

\$\endgroup\$
  • \$\begingroup\$ Have you considered using camera viewports to draw the top portion of the game separate from the bottom portion? \$\endgroup\$ – DMGregory Apr 5 at 12:31
0
\$\begingroup\$

Regardless of how you implement the running game, you can implement the Match 3 game using the UI system. A screen space canvas will always stay on the screen no matter where the camera is.

Another way to have two games in one is to have both games in the same physical space with their own cameras and separate them by using different layers. Put the two games on different layers so they don't interact with each other. Set the two camera culling masks to render one game each and then use the clear flags and depth settings to control the order in which the two games get drawn to the screen.

For more information, check out the manual section about layers and about cameras.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Note that camera stacking onto the same output image wasn't working in the new scriptable render pipeline (HDRP/URP) last year, though I understand there are workarounds and an official fix in the works — just haven't found confirmation that it's in an official version yet. You can still do it in the legacy rendering pipeline without extra fixes. \$\endgroup\$ – DMGregory Mar 1 at 13:10
  • 1
    \$\begingroup\$ @DMGregory Camera stacking is now possible in the URP. (with the exception of the 2D Renderer and the VR Multipass Mode) \$\endgroup\$ – Philipp Aug 3 at 13:10

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.