{"id":32033,"date":"2024-11-01T09:05:09","date_gmt":"2024-11-01T09:05:09","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=32033"},"modified":"2024-11-01T11:33:36","modified_gmt":"2024-11-01T11:33:36","slug":"unity-basic-course-utilizing-input-signals","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/32033\/","title":{"rendered":"Unity Basic Course: Utilizing Input Signals"},"content":{"rendered":"<p><body><\/p>\n<p>\n        Unity is a game development engine that serves as a tool to maximize interaction with users by utilizing various input signals. In this course, we will take a closer look at the basic concepts and methods of using input signals in Unity. Specifically, we will help you understand various input methods, such as keyboard, mouse, and touch, and explore how users interact with the game through them.\n    <\/p>\n<h2>1. Understanding the Input System<\/h2>\n<p>\n        Unity&#8217;s input system is primarily composed of two methods: the traditional input system and the new input system. The traditional input system is still used in many projects, but Unity has introduced a new input system that offers more flexibility and functionality. The choice of input system may depend on the needs of the game you are developing.\n    <\/p>\n<h2>1.1 Traditional Input System<\/h2>\n<p>\n        The traditional input system collects data from input devices such as keyboards, mice, and joysticks using the <code>Input<\/code> class. This allows for the implementation of simple functionalities. For example, you can check whether a specific key is pressed and respond to it.\n    <\/p>\n<pre><code>if (Input.GetKeyDown(KeyCode.Space))\n{\n    \/\/ Code executed when the space key is pressed\n    Jump();\n}<\/code><\/pre>\n<h2>1.2 New Input System<\/h2>\n<p>\n        The new input system supports a more complex structure of inputs. This system operates on an event-driven basis and allows for data binding and customization. You can set up and use the new input system in the Unity editor, and it supports inputs seamlessly across various platforms.\n    <\/p>\n<h2>2. Composition of Input Signals<\/h2>\n<p>\n        Input signals represent various user actions such as key presses, mouse clicks, drags, or touches. To utilize them effectively, the input signals must first be properly composed. Input signals can be categorized as follows:\n    <\/p>\n<ul>\n<li>Keyboard Input<\/li>\n<li>Mouse Input<\/li>\n<li>Joystick and Gamepad Input<\/li>\n<li>Touch Input<\/li>\n<\/ul>\n<h2>2.1 Handling Keyboard Input<\/h2>\n<p>\n        Keyboard input is most commonly used to control game characters or perform specific actions in Unity. You can use Unity&#8217;s <code>Input.GetKey<\/code>, <code>Input.GetKeyDown<\/code>, and <code>Input.GetKeyUp<\/code> methods to handle keyboard events. This allows you to control actions based on various input methods.\n    <\/p>\n<h2>2.2 Handling Mouse Input<\/h2>\n<p>\n        Mouse input is important for handling user interactions such as clicks and drags. In Unity, you can retrieve the current mouse position using <code>Input.mousePosition<\/code> and detect mouse button clicks using <code>Input.GetMouseButton<\/code> and <code>Input.GetMouseButtonDown<\/code> methods.\n    <\/p>\n<h2>2.3 Handling Touch Input<\/h2>\n<p>\n        On touch-based devices such as smartphones and tablets, touch input is processed using the <code>Input.touchCount<\/code> and <code>Input.GetTouch()<\/code> methods. This type of input plays a crucial role, especially in mobile games, allowing for the implementation of multi-touch functionality that accepts input from multiple fingers.\n    <\/p>\n<h2>3. Examples of Utilizing Input Signals<\/h2>\n<p>\n        Let&#8217;s take a look at a few simple examples of utilizing input signals. We will see how to implement the movement and jumping functionality of a game character and check how input signals can be applied in practice.\n    <\/p>\n<h3>3.1 Implementing Character Movement<\/h3>\n<p>\n        First, let&#8217;s write a script for character movement. You can implement physics-based movement using the <code>Rigidbody<\/code> component.\n    <\/p>\n<pre><code>using UnityEngine;\n\npublic class PlayerMovement : MonoBehaviour\n{\n    public float moveSpeed = 5f;\n    private Rigidbody rb;\n\n    void Start()\n    {\n        rb = GetComponent<rigidbody>();\n    }\n\n    void Update()\n    {\n        float moveHorizontal = Input.GetAxis(\"Horizontal\");\n        float moveVertical = Input.GetAxis(\"Vertical\");\n\n        Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);\n        rb.MovePosition(transform.position + movement * moveSpeed * Time.deltaTime);\n    }\n}<\/rigidbody><\/code><\/pre>\n<h3>3.2 Implementing Character Jump<\/h3>\n<p>\n        Now, let&#8217;s add the functionality for the character to jump. The jump feature needs to be implemented considering the effects of gravity. Add the necessary variables and input handling for jumping.\n    <\/p>\n<pre><code>using UnityEngine;\n\npublic class PlayerJump : MonoBehaviour\n{\n    public float jumpForce = 300f;\n    private Rigidbody rb;\n    private bool isGrounded;\n\n    void Start()\n    {\n        rb = GetComponent<rigidbody>();\n    }\n\n    void Update()\n    {\n        if (isGrounded &amp;&amp; Input.GetKeyDown(KeyCode.Space))\n        {\n            rb.AddForce(Vector3.up * jumpForce);\n        }\n    }\n\n    private void OnCollisionEnter(Collision collision)\n    {\n        if (collision.gameObject.CompareTag(\" ground\"))\n        {\n            isGrounded = true;\n        }\n    }\n\n    private void OnCollisionExit(Collision collision)\n    {\n        if (collision.gameObject.CompareTag(\" ground\"))\n        {\n            isGrounded = false;\n        }\n    }\n}<\/rigidbody><\/code><\/pre>\n<h2>4. Optimizing Input Signals<\/h2>\n<p>\n        Optimizing input signals is an important step in improving the performance of the game. You can reduce unnecessary calculations when detecting input and increase efficiency by switching to an event-driven system. If necessary, applying debounce or throttle techniques to input can improve performance.\n    <\/p>\n<h2>5. Conclusion<\/h2>\n<p>\n        By utilizing input signals in Unity, you can improve interaction with users. In this course, we explored the basic input signal processing and utilization methods. We hope you have laid the foundation to add and develop more complex features in the future. Challenge yourself to creative and innovative game development through a deeper understanding of input signals.\n    <\/p>\n<h2>6. References<\/h2>\n<ul>\n<li>\n<a href=\"https:\/\/docs.unity3d.com\/Manual\/ConventionalGameInput.html\">Unity Documentation: Input System<\/a>\n<\/li>\n<li>\n<a href=\"https:\/\/docs.unity3d.com\/Packages\/com.unity.inputsystem@1.0\/manual\/index.html\">Unity Input System Manual<\/a>\n<\/li>\n<li>\n<a href=\"https:\/\/www.youtube.com\/watch?v=8HF3i5ZH1b4\">Unity Beginner Course YouTube Link<\/a>\n<\/li>\n<\/ul>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Unity is a game development engine that serves as a tool to maximize interaction with users by utilizing various input signals. In this course, we will take a closer look at the basic concepts and methods of using input signals in Unity. Specifically, we will help you understand various input methods, such as keyboard, mouse, &hellip; <a href=\"https:\/\/atmokpo.com\/w\/32033\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;Unity Basic Course: Utilizing Input Signals&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[135],"tags":[],"class_list":["post-32033","post","type-post","status-publish","format-standard","hentry","category-unity-basic"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Unity Basic Course: Utilizing Input Signals - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/atmokpo.com\/w\/32033\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Unity Basic Course: Utilizing Input Signals - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"Unity is a game development engine that serves as a tool to maximize interaction with users by utilizing various input signals. In this course, we will take a closer look at the basic concepts and methods of using input signals in Unity. Specifically, we will help you understand various input methods, such as keyboard, mouse, &hellip; \ub354 \ubcf4\uae30 &quot;Unity Basic Course: Utilizing Input Signals&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/32033\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T09:05:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-01T11:33:36+00:00\" \/>\n<meta name=\"author\" content=\"root\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:site\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"root\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"4\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/32033\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/32033\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"Unity Basic Course: Utilizing Input Signals\",\"datePublished\":\"2024-11-01T09:05:09+00:00\",\"dateModified\":\"2024-11-01T11:33:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/32033\/\"},\"wordCount\":614,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"Unity Basic\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/32033\/\",\"url\":\"https:\/\/atmokpo.com\/w\/32033\/\",\"name\":\"Unity Basic Course: Utilizing Input Signals - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T09:05:09+00:00\",\"dateModified\":\"2024-11-01T11:33:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/32033\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/32033\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/32033\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Unity Basic Course: Utilizing Input Signals\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/atmokpo.com\/w\/#website\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/atmokpo.com\/w\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"contentUrl\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"width\":400,\"height\":400,\"caption\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\"},\"image\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/bebubo4\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\",\"name\":\"root\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"caption\":\"root\"},\"sameAs\":[\"http:\/\/atmokpo.com\/w\"],\"url\":\"https:\/\/atmokpo.com\/w\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Unity Basic Course: Utilizing Input Signals - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/atmokpo.com\/w\/32033\/","og_locale":"ko_KR","og_type":"article","og_title":"Unity Basic Course: Utilizing Input Signals - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"Unity is a game development engine that serves as a tool to maximize interaction with users by utilizing various input signals. In this course, we will take a closer look at the basic concepts and methods of using input signals in Unity. Specifically, we will help you understand various input methods, such as keyboard, mouse, &hellip; \ub354 \ubcf4\uae30 \"Unity Basic Course: Utilizing Input Signals\"","og_url":"https:\/\/atmokpo.com\/w\/32033\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T09:05:09+00:00","article_modified_time":"2024-11-01T11:33:36+00:00","author":"root","twitter_card":"summary_large_image","twitter_creator":"@bebubo4","twitter_site":"@bebubo4","twitter_misc":{"\uae00\uc4f4\uc774":"root","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"4\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/32033\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/32033\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"Unity Basic Course: Utilizing Input Signals","datePublished":"2024-11-01T09:05:09+00:00","dateModified":"2024-11-01T11:33:36+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/32033\/"},"wordCount":614,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["Unity Basic"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/32033\/","url":"https:\/\/atmokpo.com\/w\/32033\/","name":"Unity Basic Course: Utilizing Input Signals - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T09:05:09+00:00","dateModified":"2024-11-01T11:33:36+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/32033\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/32033\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/32033\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"Unity Basic Course: Utilizing Input Signals"}]},{"@type":"WebSite","@id":"https:\/\/atmokpo.com\/w\/#website","url":"https:\/\/atmokpo.com\/w\/","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","description":"","publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/atmokpo.com\/w\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/atmokpo.com\/w\/#organization","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","url":"https:\/\/atmokpo.com\/w\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/","url":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","contentUrl":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","width":400,"height":400,"caption":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8"},"image":{"@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/bebubo4"]},{"@type":"Person","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7","name":"root","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","caption":"root"},"sameAs":["http:\/\/atmokpo.com\/w"],"url":"https:\/\/atmokpo.com\/w\/author\/root\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/32033","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/comments?post=32033"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/32033\/revisions"}],"predecessor-version":[{"id":32034,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/32033\/revisions\/32034"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=32033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=32033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=32033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}