{"id":1557,"date":"2021-09-05T13:08:15","date_gmt":"2021-09-05T13:08:15","guid":{"rendered":"http:\/\/mycours.es\/gamedesign2021\/?page_id=1557"},"modified":"2021-11-18T16:01:26","modified_gmt":"2021-11-18T16:01:26","slug":"resources-control-system-templates","status":"publish","type":"page","link":"http:\/\/mycours.es\/gamedesign2021\/resources-control-system-templates\/","title":{"rendered":"Resources: Control system templates"},"content":{"rendered":"<h2>Two Axis Movement and Camera Follow<\/h2>\n<p>I made this video to function also as an intro to Unity scripting so check it out to refresh your memory<\/p>\n<p><iframe loading=\"lazy\" title=\"Unity - two axis movement and camera follow\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/ftpnBwTueBs?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p><a href=\"https:\/\/drive.google.com\/file\/d\/1IXz8GmQjU7KnSLN72-saptOSf7xfi_6i\/view?usp=sharing\">UnityPackage here<\/a><\/p>\n<h2>FPS controls &#8211; Gold Player<\/h2>\n<p>A complete open source component for first person shooter like movement and camera management. It has head bob, step sounds etc. If it&#8217;s a bit of an overkill for your project check the template below<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1560\" src=\"http:\/\/mycours.es\/gamedesign2021\/files\/2021\/09\/editor-1024x441.png\" alt=\"\" width=\"840\" height=\"362\" srcset=\"http:\/\/mycours.es\/gamedesign2021\/files\/2021\/09\/editor-1024x441.png 1024w, http:\/\/mycours.es\/gamedesign2021\/files\/2021\/09\/editor-300x129.png 300w, http:\/\/mycours.es\/gamedesign2021\/files\/2021\/09\/editor-768x331.png 768w, http:\/\/mycours.es\/gamedesign2021\/files\/2021\/09\/editor-1536x661.png 1536w, http:\/\/mycours.es\/gamedesign2021\/files\/2021\/09\/editor-2048x882.png 2048w, http:\/\/mycours.es\/gamedesign2021\/files\/2021\/09\/editor-1200x517.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><a href=\"https:\/\/github.com\/Hertzole\/gold-player\">https:\/\/github.com\/Hertzole\/gold-player<\/a><\/p>\n<h2>Simple First Person Controls<\/h2>\n<p><iframe loading=\"lazy\" title=\"Unity First Person Kit - scripting\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/hjWnSUoGnE0?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p><strong><a href=\"https:\/\/drive.google.com\/file\/d\/1zOqF-iwRMEbOcCwfyRDoqc_4gtcRFmdz\/view?usp=sharing\">Download the first person controller + interactable + teleport scripts.<\/a><\/strong><\/p>\n<h2>FPS with Rigidbody<\/h2>\n<p>Unity&#8217;s character controller doesn&#8217;t rely on rigid bodies, making physics driven controls more complicated.<br \/>\nThis template and tutorial show you how to implement a simple FPS controller that uses physics:<\/p>\n<p><iframe loading=\"lazy\" title=\"Unity FPS Movement Tutorial by Dani  |  Karlson Parkour FPS Controller\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/XAC8U9-dTZU?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p><a href=\"https:\/\/github.com\/DaniDevy\/FPS_Movement_Rigidbody\">https:\/\/github.com\/DaniDevy\/FPS_Movement_Rigidbody<\/a><\/p>\n<h3><strong>2d platformer<\/strong><\/h3>\n<p><iframe loading=\"lazy\" title=\"Unity 2D Movement (Smooth &amp; Tight Controls - No Rigidbodies)\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/SVACshnciMk?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p><a href=\"https:\/\/github.com\/krthush\/2d-unity-movement\">https:\/\/github.com\/krthush\/2d-unity-movement<\/a><\/p>\n<h2>Point and Click<\/h2>\n<p>Point and click movements with pathfinding is a complex problem, thankfully Unity provides a navigation mesh component that makes it super easy to implement<\/p>\n<p><iframe loading=\"lazy\" title=\"Navigation Basics   Click to Move\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/z8H23L51F6Q?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p><a href=\"https:\/\/unity3d.college\/2017\/08\/24\/unity-navigation-basics-click-to-move\/\">Text tutorial and script here<\/a><\/p>\n<h2>3rd Person Shooter Movement<\/h2>\n<p>It may seem like a variation of the FPS movement but it&#8217;s more complicated because the movement and the camera controls are connected and actually implementing a good camera is not trivial.<br \/>\nThis tutorial introduces the unity package cinemachine, which does a <strong>LOT<\/strong> of heavy lifting for you such as the view occlusion.<\/p>\n<p><iframe loading=\"lazy\" title=\"THIRD PERSON MOVEMENT in Unity\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/4HpC--2iowE?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p><a href=\"https:\/\/drive.google.com\/file\/d\/1HMsY8SIBt0vTWpNhsg7jEv_ckqjky7pq\/view?usp=sharing\">Script used in the tutorial<\/a><br \/>\nIf you want to bind the look to a standard joypad right stick go to project settings &gt; Input Manager &gt; and change mouse X and mouse Y to the 4th and 5th axis respectively.<\/p>\n<h2>Vehicle controls<\/h2>\n<p>Vehicle controls are usually heavily dependent on physics and they can get quite complicated and specific. This tutorial below is a good template that can be adapted to a variety of cases.<\/p>\n<p>I implemented decode described below and fixed some issues with the controller, you can download a <a href=\"https:\/\/drive.google.com\/file\/d\/1V-RcXPg-jm7J3Zf-yWEEzWdpkPrV7dhE\/view?usp=sharing\">package here<\/a>.<br \/>\nIt includes the script and a prefab car but not the race track scenario <a href=\"https:\/\/drive.google.com\/file\/d\/1qVal_BSXdE5mYtA_8douoVSKkYNIAM3w\/view\">which you can find here<\/a><\/p>\n<p><iframe loading=\"lazy\" title=\"Arcade Car Driving in Unity\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/cqATTzJmFDY?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p>You can find more realistic <a href=\"https:\/\/assetstore.unity.com\/packages\/tools\/physics\/arcade-car-physics-119484\">systems like this one<\/a> but they will be harder to figure out and modify.<\/p>\n<h2>Dynamic Camera<\/h2>\n<p>Cinemachine can facilitate other kinds of dynamic cameras like the one used in A Short Hike<\/p>\n<p><iframe loading=\"lazy\" title=\"Crafting A Tiny Open World: A Short Hike Postmortem\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/ZW8gWgpptI8?start=686&#038;feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<h2>Graphic User Interface (UI)<\/h2>\n<p>If your game view incorporates a user interface or some kind of overlay (eg. visual novel portraits), you want to learn Unity&#8217;s UI system. You can find plenty of tutorials, here&#8217;s my intro one which also covers off screen camera rendering &#8211; how to composite camera views in the interface.<\/p>\n<p><iframe loading=\"lazy\" title=\"Unity UI + off screen camera rendering\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/qfNfPmfSiNw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p><a href=\"https:\/\/drive.google.com\/file\/d\/1cuOJoZnld7GLjCeExwxJRwYh-3C5vYzc\/view?usp=sharing\">UI example file here<\/a><\/p>\n<h2>New Input System<\/h2>\n<p>Unity has a new input system that you may want to consider for the final project later on.<br \/>\nIt&#8217;s a bit more esoteric at first but it should take take of controller compatibility issues across platforms.<\/p>\n<p><iframe loading=\"lazy\" title=\"How to use the New Unity Input System\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/zIhtPSX8hqA?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Two Axis Movement and Camera Follow I made this video to function also as an intro to Unity scripting so check it out to refresh your memory UnityPackage here FPS controls &#8211; Gold Player A complete open source component for first person shooter like movement and camera management. It has head bob, step sounds etc. &hellip; <a href=\"http:\/\/mycours.es\/gamedesign2021\/resources-control-system-templates\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Resources: Control system templates&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":24,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1557","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/mycours.es\/gamedesign2021\/wp-json\/wp\/v2\/pages\/1557","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/mycours.es\/gamedesign2021\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/mycours.es\/gamedesign2021\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/mycours.es\/gamedesign2021\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/mycours.es\/gamedesign2021\/wp-json\/wp\/v2\/comments?post=1557"}],"version-history":[{"count":9,"href":"http:\/\/mycours.es\/gamedesign2021\/wp-json\/wp\/v2\/pages\/1557\/revisions"}],"predecessor-version":[{"id":1568,"href":"http:\/\/mycours.es\/gamedesign2021\/wp-json\/wp\/v2\/pages\/1557\/revisions\/1568"}],"wp:attachment":[{"href":"http:\/\/mycours.es\/gamedesign2021\/wp-json\/wp\/v2\/media?parent=1557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}