<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Fernando Alcantara Santana on Medium]]></title>
        <description><![CDATA[Stories by Fernando Alcantara Santana on Medium]]></description>
        <link>https://medium.com/@fas444?source=rss-bc9ab25c021f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*l6PjPkFqyt6v9iDKDOijwQ.jpeg</url>
            <title>Stories by Fernando Alcantara Santana on Medium</title>
            <link>https://medium.com/@fas444?source=rss-bc9ab25c021f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 15:51:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fas444/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Publishing to the Google Play store]]></title>
            <link>https://fas444.medium.com/publishing-to-the-google-play-store-1f225d16759e?source=rss-bc9ab25c021f------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f225d16759e</guid>
            <category><![CDATA[gamedev]]></category>
            <category><![CDATA[gamedevhq]]></category>
            <category><![CDATA[google-play-store]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[google-play]]></category>
            <dc:creator><![CDATA[Fernando Alcantara Santana]]></dc:creator>
            <pubDate>Mon, 31 Jan 2022 17:05:12 GMT</pubDate>
            <atom:updated>2022-02-06T14:47:37.939Z</atom:updated>
            <content:encoded><![CDATA[<h4>Unity Guide</h4><h4>A quick guide about how to publish a mobile game to the Google Play store</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bj7eG6jRXD5Ao-JTZwqBzQ.gif" /></figure><p><strong>Objective</strong>: Publish a 2D mobile game made with Unity to the Google Play store.</p><p>In the last post I covered <a href="https://medium.com/nerd-for-tech/rewarded-video-ads-unity-28a9baebaa91">how to implement rewarded video ads in our mobile game with Unity</a>. Now, it’s time to publish our finished game into the Google Play store.</p><h3>Create a developer account</h3><p>To start, we’ll need to create our developer account in the next site:</p><p><a href="https://play.google.com/console/about/">Google Play Console | Google Play Console</a></p><p>Once in there, we’ll see a button to enter the Google Play console and we’ll have to click it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WPdarfdW6Lr8VRXggoTg6g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*vbyqRPTHQiJzrkx5djF_7w.png" /></figure><p>Then, we’ll need to select one Google account to be our developer account.</p><p>There are 2 types of developer accounts:</p><ul><li>For you (personal)</li><li>For your organization or company</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*fLUwz68RiCNqBubC51Hk4w.png" /></figure><p>If you, like me, choose a personal account, you will need to provide personal information and pay a 25 USD unique fee to publish your games or apps on the Google Play store:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*sk2umQR5eiP_FzYBuqSb3Q.png" /></figure><p>Once the information was provided and the fee was paid, we’ll be able to see the Google Play Console, where we’ll see all of the apps that we publish and its analytics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9WQLmyN88L_KzoUlsh1DrQ.png" /></figure><h3>Build your game with Unity</h3><p>Now that we have our developer account to publish our game in the Google Play store, we need to build our finished game in Unity.</p><h4>Configure your game settings</h4><p>To start, let’s open the <strong>Build Settings</strong> window by clicking on <strong><em>File &gt; Build Settings</em></strong>. Then, let’s open the<strong> Player Settings</strong> by clicking on the left button at the bottom of the window:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*voVtJz_Be0LmUhGzxSV1XQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*-YsU9NdogxgZjkllc4DS3w.gif" /></figure><p>Once opened, let’s make sure to fill the information and set the correct settings for our game to be deployed as we want:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iYDEwesEg72JFtRg_SZLTw.gif" /></figure><h4>Sign the game</h4><p>Next, when the information has been filled and the correct settings are applied, we’ll need to create a new <strong>keystore</strong>. A keystore will allow us to sign the app and identify us as the developer to avoid unauthorized use (it’s mandatory to upload a signed app to the Google Play Store).</p><p>So, in order to sign our app with a keystore, let’s open the <strong>Keystore Manager </strong>window by clicking on the respective button at the <strong>Publishing Settings</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5gCZqu30ljfFI5Ye9BrS6Q.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*aNoRbtkkI8pjVqC3N9DeFw.png" /></figure><p>Once opened, let’s <strong>select to create a new</strong> <strong>keystore with a new key</strong> and <strong>select the location</strong> to save them. Once selected, let’s <strong>set a secure password</strong> and <strong>fill the respective information</strong> that the key needs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*LKo06A_gYMBq6MK2ttLROQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*XmFnjfelPvuJ28SrecMYZg.gif" /></figure><p>Finally, when we complete the fields, let’s <strong>add the key</strong> by clicking on the right button at the bottom:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*LdPMPoBnQzS6vLZBOoVI8w.png" /></figure><p>Then, let’s <strong>confirm </strong>in the window that will be prompted to set the key and the keystore for our project:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*s0G8D8RVz-wpfKKFSdQx9w.png" /></figure><h4>Build the game</h4><p>And now, in order to build our game, let’s return to the <strong>Build Settings</strong> window, where we’ll need to enable the <strong><em>Build App Bundle (Google Play) </em></strong>option before clicking on the <strong><em>Build </em></strong>button to create an AAB file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*68c3FDIt9Bgs0DwZJ04ocQ.gif" /></figure><p>Then, after selecting the folder to build the game, let’s wait for Unity to build it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*14AW9Rrn5yD-l494-G0UFQ.png" /></figure><p>Next, the respective folder will be prompted and we’ll see our AAB file. In case that you want an APK file you just need to disable the <strong><em>Build App Bundle (Google Play) </em></strong>option on your build settings.</p><blockquote>Remember that the Google Play Store needs an AAB file and not an APK file to publish your game.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P2dt94NsbmmjccstrKCxAg.png" /></figure><h3>Issues found</h3><p>Now, before moving to publish our game into the Google Play store, let’s take a look at some of the issues that I found before publishing my game and how did I manage to solve them:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VKeg2lzODoIndRorAUrK1g.gif" /></figure><blockquote><strong>Not compliant with the Google Play 64-bit requirement</strong></blockquote><p>This error message appeared after uploading my AAB file to the store and it stated that my app bundle had only 32-bit native code. So, what I did to solve it was to:</p><ul><li>Open the <strong>Project Settings </strong>window</li><li>Select the <strong>Player </strong>tab</li><li>Go to <strong><em>Other Settings</em></strong></li><li>Change the configuration of the <strong>Scripting Backend </strong>to be<strong> IL2CPP</strong></li><li><strong>Select </strong>both <strong>ARMv7 </strong>and <strong>ARM64 </strong>as target architectures</li><li>Build the game again</li></ul><blockquote><strong>The bundle was signed in debug mode</strong></blockquote><p>This error message appeared after uploading my AAB file too and it stated that my bundle was signed in a debug mode. To solve this I just did make sure that my project had a <strong>keystore with a key</strong> selected before building my game like we did in the steps above.</p><blockquote><strong>The app should have a minimum specified API of level 30</strong></blockquote><p>This error message appeared after uploading my AAB file too and it stated that the app should be built with a minimum target API of level 30. So, what I did to solve it was to:</p><ul><li>Open the <strong>Project Settings </strong>window</li><li>Select the <strong>Player </strong>tab</li><li>Go to <strong><em>Other Settings</em></strong></li><li>Change the <strong>Minimum API Level </strong>to be of level 30</li><li>Change the <strong>Target API Level</strong> to be of level 30</li><li>Build the game again</li></ul><h3>Publish the app on the Google Play store</h3><p>Now that we have our AAB file we’ll need to fill some requirements before publishing it in the Google Play Store.</p><p>To start, let’s go to the <a href="https://play.google.com/console">Google Play Console</a> using our developer account and click on the <strong>Create App</strong> button to be able to create a new draft of our game:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*USw4BbPFqYC-NCK7nL76Cg.gif" /></figure><p>Once clicked, we’ll need to fill or accept several details to publish our game:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iA7QAe_I72b7ljXduS52gQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9bCby3mlsyT82wCNUkg9lA.png" /></figure><p>Then, after the fields are completed, let’s click on the <strong>Create App</strong> button to create the new draft of our game:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/1*vTCzM8b2MAZ4YhjjX06Xsw.gif" /></figure><p>Once created, we’ll be able to see the <strong>dashboard </strong>of our new app:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FbyJa96OGbhkCVBmmZVmEg.png" /></figure><p>In the dashboard we’ll see the first steps to take before publishing our app, which include:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ES96GpmksCrtkrt3NgwPAQ.png" /></figure><p>One of the steps to take is to answer a <strong>questionnaire </strong>to rate the game contents, so that it can be available to the proper users when it gets published:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Fk1maw_LHyJ6-NgBYXgIw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VZ6gJLjIxXJNcSZ_ZWyJxQ.png" /></figure><p>Once we finish the first steps we’ll need to take the production track steps, where we’ll need to:</p><ul><li>Select the countries and regions where our app will be available.</li><li>Create a new version release to be reviewed and finally published.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0opUHn75tRp_RjWqLUWD7g.png" /></figure><p>Once that we select the countries and regions of our app, let’s create a new production release:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0-thizzIHsslps_9pMVpZA.png" /></figure><p>In here, we’ll need to upload the AAB file that we built in Unity before:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5iQON4tykMRPSPcphbxqow.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MlQc0j8rhk008w9j6f3EMA.png" /></figure><p>Finally, once it’s uploaded, let’s just save our release and click on the review button at the bottom of the page. If everything goes as expected we’ll be able to see our app status as <strong><em>In review </em></strong>and we’ll just need to wait some hours or days to see our app published on the Google Play store:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kcRYPgHrBOGKV-N4inLdIQ.png" /></figure><p>And that’s it, we published our 2D game (made with Unity) onto the Google Play store! :D. I’ll see you in the next post, where I’ll be showing new content about Unity.</p><p>If you want to try my game you can view it on the <strong>Google Play store</strong> here:</p><p><a href="https://play.google.com/store/apps/details?id=com.ElFAStidioStudios.DeepintheDungeon">Deep in the Dungeon - Apps on Google Play</a></p><p>Or you can play it online (mobile friendly) or download it (Windows) on here:</p><p><a href="https://fernandoalcasan.itch.io/deep-in-the-dungeon">Deep in the Dungeon</a></p><p>Please consider leaving a comment or rating my game, I’d really appreciate your thoughts.</p><blockquote><em>If you want to know more about me, feel free to connect with me on </em><a href="https://www.linkedin.com/in/fas444/"><strong><em>LinkedIn</em></strong></a><strong><em> </em></strong><em>or visit my </em><a href="http://fernandoalcasan.com/"><strong><em>website </em></strong></a><em>:D</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f225d16759e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rewarded video ads | Unity]]></title>
            <link>https://fas444.medium.com/rewarded-video-ads-unity-28a9baebaa91?source=rss-bc9ab25c021f------2</link>
            <guid isPermaLink="false">https://medium.com/p/28a9baebaa91</guid>
            <category><![CDATA[gamedevhq]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[gamedev]]></category>
            <category><![CDATA[game-development]]></category>
            <dc:creator><![CDATA[Fernando Alcantara Santana]]></dc:creator>
            <pubDate>Tue, 30 Nov 2021 16:22:13 GMT</pubDate>
            <atom:updated>2021-12-01T15:40:39.260Z</atom:updated>
            <content:encoded><![CDATA[<h4>Unity Guide</h4><h4>A quick guide about how to implement rewarded video ads in Unity</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jeHLUMGSfQLnAS1M1efrVg.gif" /></figure><p><strong>Objective</strong>: Implement rewarded video ads in our 2D mobile game with Unity.</p><p>In the last post I covered <a href="https://medium.com/nerd-for-tech/cross-platform-input-controller-unity-9b76545a4aa0">how to implement mobile input with Unity</a>. Now, it’s time to implement rewarded video ads in order to grant certain reward to the player if the ads are watched.</p><h3>Choose building platform</h3><p>To start, let’s make sure that the correct build platform for our game is selected. To implement Unity ads in our game we’ll need to choose between Android or iOS. In our case, we’ll choose Android, therefore, let’s open the build settings and make sure to switch the build platform:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*MY94EExFXLhMG1dczs_Whw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*nA4ISoeyRq4qKifCz5nuAg.png" /></figure><h3>Import ads package</h3><p>Then, to be able to implement the Unity ads, let’s import the respective package from Unity Technologies by using the <strong>Package Manager</strong>. Make sure to open the package manager and look within the <strong>Unity Registry</strong> for the Advertisement package to click on the <strong><em>Install </em></strong>button:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*daqidcvF4vNHceUiizAaow.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NY6rR315l-MqS1LHFoB4Uw.png" /></figure><h3>Unity Project ID</h3><p>Next, let’s make sure to create an Unity Project ID to be able to use and associate the Unity Ads with our account. To do it, let’s open the <strong>Project Settings</strong> and within the <strong>Services </strong>tab we’ll be able to choose an organization of our account:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/1*R9LOv1qeTS39mKhDp8V2jQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XD4gcF55URl292JcLhH8NA.png" /></figure><h3>Enable Ads</h3><p>Once the project is associated with an organization let’s enable the ads for the project by opening the <strong>Services </strong>window and clicking on the <strong>Ads </strong>section:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*pwiXtlYvRSejXUlgbL_G2w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*ADVpMTKzAhYlH5hGjRw4KQ.gif" /></figure><p>Then, let’s make sure to define the COPPA compliance for the project to determine if the ads will be for children under age of 13 or not. Once done, we’ll be able to see that the Ads section is now enabled:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gkxzP1kyslGfn9xi5ppnkg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4LzRjKgoIF0luyuYlH2WAw.png" /></figure><p>Next, let’s enable the test mode within the same section to test if our ads will work (and avoid being tagged for fraud):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*5M4pVLYignB8Wt4b2ZJdAg.png" /></figure><p>Finally, let’s go to the <a href="https://dashboard.unity3d.com/"><strong>Unity dashboard</strong></a><strong> </strong>and make sure to complete the Ads activation in the respective project. We’ll be using just<strong> Unity Ads</strong> and <strong>not</strong> Unity Mediation in our game:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n-JYkig_tjl0PFBFlH0VkQ.gif" /></figure><p>Once the ads are enabled we’ll see the Ad Units, which are important to select which type of ad we’ll be using in our game. In this case, as we’re implementing rewarded videos, we’ll be using the <strong>Rewarded Android </strong>ad unit. It’s also important to notice the Game ID’s (which are unique) above the Ad Units as it will be important to associate the ads shown with our account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3TZE56IkMdI0KNlsfiue9g.png" /></figure><blockquote>An Ad Unit is a collection of ad format settings for content serving at a single surfacing point in your game. Use them to designate the surfacing point to serve rewarded or interstitial ads. You can also use Ad Units to configure advanced settings, such as ad types and whether to allow skipping.</blockquote><h3>Create the ads button</h3><p>Once our project is ready to test the Unity ads, we’ll need a button to test the rewarded videos. If you’ve been following <a href="https://fas444.medium.com/">my latest posts</a> then you’ll remember that we had <a href="https://medium.com/nerd-for-tech/onclick-events-unity-f4805203b039">implemented a store</a> for our game, so, let’s use the respective shop button to test our rewarded videos:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SoOVD9TeUhReC0dAlY0Ang.png" /></figure><h3>Implementing the Advertisement package</h3><p>And now, in order to start using the Unity ads in our game, let’s start by opening the Shop script that handles the shop. Then, let’s:</p><ul><li>Add the <strong>UnityEngine.Advertisements</strong> namespace at the top to be able to use the Unity ads SDK in this script.</li><li>Implement the next interfaces (which will allow us to handle the ads):</li></ul><ol><li><strong>IUnityAdsInitializationListener</strong></li><li><strong>IUnityAdsLoadListener</strong></li><li><strong>IUnityAdsShowListener</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QDbbafb1VVFtPDDCPTQ1PA.png" /></figure><p>Each interface implements the next methods:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0wXkO1zU9xRjUHkeC9G3aw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wZ3Gwe8QKx6QEX2ojcK9iA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sx7nYQ7VARusiCsp5tqXnQ.png" /></figure><p>If you want to know more about each one of these methods you can check the official Unity API reference here:</p><p><a href="https://unityads.unity3d.com/help/unity/api-unity">Unity API reference</a></p><p>Next, let’s add the next variables, which we’ll use to handle the Unity ads SDK:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*hqd58uLYObzB7L1BG_BuhA.png" /></figure><ul><li>Android game ID</li></ul><p>This variable will store the game ID of Android to associate it with the project in your organization. You can find this ID on your <a href="https://dashboard.unity3d.com/">Unity dashboard</a>.</p><ul><li>Test mode</li></ul><p>This variable will indicate if the ads should be displayed on test mode or not.</p><ul><li>Enable per placement mode</li></ul><p>This variable will indicate if the SDK should be initialized with the Load API lifecycle.</p><ul><li>Rewarded video ID</li></ul><p>This variable will store <strong>Ad Unit ID</strong> of the rewarded video.</p><ul><li>Reward button</li></ul><p>This variable will store a reference to the ad button in order to enable or disable it according to the SDK initialization and load process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*lDpIgktc86ayyMUBPvfL5g.png" /></figure><p>Once the variables have their respective value defined, let’s create a new method to initialize the Unity ads SDK using the respective values as parameters:</p><blockquote>Note: The Unity ads SDK must be initialized before loading any ad in our game.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q6c9ZcEdlS4uMK60ELdm4Q.png" /></figure><p>Then, let’s call the method on the <strong>Awake </strong>method to make sure that the SDK initializes at the very start:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*2CHeN9QW3SREuE2yRKYj_g.png" /></figure><p>Next, let’s create a new method to load the rewarded video ad. We’ll need to use the <strong>Advertisement.Load</strong> method with the respective<strong> Ad Unit ID </strong>and a reference to the <strong>IUnityAdsLoadListener</strong> interface that we’re implementing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*36OwxmmQW0K0SMST5W89fQ.png" /></figure><p>Then, we’ll call the above method using one of the methods implemented by the <strong>IUnityAdsInitializationListener </strong>interface to make sure that the Unity ads SDK gets initialized before loading the ad:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*Pxeyh11xyF6yeR-evxdanw.png" /></figure><p>In the other method implemented by the <strong>IUnityAdsInitializationListener </strong>interface we’ll just make sure to print the error in case that the SDK fails to initialize:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i1JueMlduZcUu_9ciGVfAg.png" /></figure><p>And now, let’s define the methods implemented by the <strong>IUnityAdsLoadListener </strong>interface. First we’ll use the <strong>OnUnityAdsAdLoaded </strong>method to enable the use of the ad button if the ad was loaded successfully:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*G68vqnxuCoOdFO2heVBxpA.png" /></figure><p>And, on the other hand, if the ad didn’t load successfully, we’ll just print the error:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uDxvRsPTEsMcPQAM4gd9IA.png" /></figure><p>Then, let’s create a new public method that will be called by the <strong>OnClick </strong>event of our ad button. In this method we’ll disable the use of the button and we’ll display the loaded ad by using the <strong>Advertisement.Show </strong>method with the respective<strong> Ad Unit ID</strong> and the <strong>IUnityAdsShowListener </strong>reference (the interface we’re implementing) as parameters:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*_DkRGGE0Fym1IZavJ6jgzQ.png" /></figure><blockquote><strong>Important</strong>: Once the method was created make sure to reference it in the <strong>OnClick </strong>event of the ad button through the inspector window.</blockquote><p>Finally, in order to verify that the rewarded video was completely watched, let’s use the callback methods implemented by the <strong>IUnityAdsShowListener</strong> interface:</p><ul><li><strong>OnUnityAdsShowStart </strong>handles the logic for the ad starting to play.</li><li><strong>OnUnityAdsShowClick </strong>handles the logic for the user clicking on the ad.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*CY7DReALMDAqMVGIqj_JfQ.png" /><figcaption>We won’t use these methods for now.</figcaption></figure><ul><li><strong>OnUnityAdsShowComplete </strong>handles the logic for the ad finishing, so we will make sure to compare the <strong>UnityAdsShowCompletionState </strong>enum parameter to check if the video was successfully completed and grant the reward we want:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rTf5BHo_Je8tUb3iSsm3LQ.png" /><figcaption>Once the reward was granted make sure to <strong>load another ad </strong>so that the ad button keeps working as expected.</figcaption></figure><ul><li><strong>OnUnityAdsShowFailure </strong>handles the logic for the Ad Unit failing to show, so we’ll print the error in that case and load another ad.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ker1HkGuZblpQd6wOQbtPg.png" /></figure><p>And now, if we run the game with Unity we’ll see that the Unity ads SDK gets initialized as expected:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*yCwny334BukORmbrIZvexw.png" /></figure><p>And, if we use the button in our shop, we’ll be able to see the respective test ad as we’re using the test mode:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Np5r6GykkXePItll-B13yw.gif" /><figcaption>When your ads are ready be sure to deactivate the test mode on both sides (code and dashboard) of Unity.</figcaption></figure><p>And that’s it, we implemented rewarded videos for our game with Unity! :D. I’ll see you in the next post, where I’ll be showing how to publish our Unity game to the Google Play Store.</p><blockquote><em>If you want to know more about me, feel free to connect with me on </em><a href="https://www.linkedin.com/in/fas444/"><strong><em>LinkedIn</em></strong></a><strong><em> </em></strong><em>or visit my </em><a href="http://fernandoalcasan.com/"><strong><em>website </em></strong></a><em>:D</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28a9baebaa91" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cross platform input controller | Unity]]></title>
            <link>https://fas444.medium.com/cross-platform-input-controller-unity-9b76545a4aa0?source=rss-bc9ab25c021f------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b76545a4aa0</guid>
            <category><![CDATA[gamedevhq]]></category>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[gamedev]]></category>
            <category><![CDATA[cross-platform]]></category>
            <dc:creator><![CDATA[Fernando Alcantara Santana]]></dc:creator>
            <pubDate>Wed, 24 Nov 2021 18:25:30 GMT</pubDate>
            <atom:updated>2021-11-26T16:04:23.864Z</atom:updated>
            <content:encoded><![CDATA[<h4>Unity Guide</h4><h4>A quick guide about how to implement mobile input in Unity</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qsp5cLJpbO6IlfxXqLP_Fw.gif" /></figure><p><strong>Objective</strong>: Implement cross platform input in our game to work on mobile with the new input system in Unity.</p><p>In the last post I covered <a href="https://fas444.medium.com/onclick-events-unity-f4805203b039">how to work with OnClick events in Unity</a>. Now, it’s time to use the new input system in Unity to implement a way for mobile input to work in our platformer game.</p><h3>Before starting</h3><p>If you’ve been following my previous posts, then you’ll remember that I implemented the movement and other mechanics using the new input system in Unity. I truly recommend to check these posts before starting this post in case that you don’t know how to use the new input system:</p><ul><li><a href="https://medium.com/nerd-for-tech/moving-with-the-new-input-system-unity-a6c9cb100808">Moving with the new input system | Unity</a></li><li><a href="https://medium.com/nerd-for-tech/implementing-a-jump-mechanic-unity-6420b106e47a">Implementing a jump mechanic | Unity</a></li></ul><h3>Current input actions</h3><p>In the current input actions asset we contain 3 different actions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kWAZu3g9vGbRN1vHj_PIWA.png" /></figure><ul><li><strong>Movement</strong></li></ul><p>This action is bonded with a 1D axis value to indicate if he player should move to the left or to the right.</p><ul><li><strong>Jump</strong></li></ul><p>This action indicates when the player should jump and it’s bonded with the space key.</p><ul><li><strong>Attack</strong></li></ul><p>This action indicates when the player should attack and it’s bonded with the left click from the mouse.</p><p>As you can see in the top left corner, the actions are bonded to the <strong>Keyboard </strong>control scheme. But what if we want our game to receive input from a mobile screen?… It’s really easy, we just need to add a new control scheme for the mobile input:</p><h3>New control scheme</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5BBIfciOZRJSZJgsUBJSrw.gif" /></figure><p>Once we add the <strong><em>Touch</em></strong> control scheme we’ll be able to see the same 3 actions that we have with the <strong><em>Keyboard</em></strong> scheme, and, as our player will only need to move left or right, we can bind a new 1D axis value to the movement action:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*csh89NJcg2zuos0ccGNxrw.gif" /></figure><p>Once the value is bonded, let’s select the respective axis to use it as our input. As in many mobile games, we can choose to select the <strong>default</strong> left stick of a gamepad and the left or right direction according to the 1D axis values:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RK6EALhuT_ejbZK2xejzfg.gif" /></figure><p>This way we’ll be able to move the player to the left when the <strong>gamepad stick</strong> goes to the left or when the <strong>A</strong> key is pressed on a keyboard.</p><blockquote>Note: Don’t forget to click the <strong><em>Save Asset</em></strong> button after selecting the input path.</blockquote><h3>Adding the mobile input</h3><p>And now, in order to use the mobile input, let’s add the respective sprites into the canvas. To move we’ll use a left stick and to jump and attack we’ll use two buttons at the right:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QCZ7nffjLQ6GALDtwEkALg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*Tm-liHfBqp3raMBYjErZxg.png" /></figure><p>Once the sprites are added, let’s select the left stick image and attach an <strong>On-Screen Stick</strong> component that will provide it a stick behavior with the option to assign its movement range:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*ocQ0nKD-xFoD-fiw7bEOQw.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*oMivOd6sxTWN4J-0VwTH6w.gif" /></figure><p>Finally, in order to connect the stick input with the new <strong>Touch </strong>control scheme, let’s select the respective control path (<strong>Gamepad’s left stick</strong>) through the inspector. And then, If we run the game, we’ll be able to drag the stick as in a mobile device according to the movement range value that we choose:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*ddFOkeKu2McVief7dPLKEA.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*nou0aMwoFP5yzer61DAa7A.gif" /></figure><p>Once the respective control path is selected, let’s run the game and we’ll be able to see that the mobile input works as expected:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1JCu0mocNdgTlyGm_trUFw.gif" /></figure><h3>Extra (buttons)</h3><p>If we want to implement the buttons we’ll just have to follow the same process for the other actions in the input actions asset. Just select the respective control path to bond with the action:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xoF9GWMBVootgnVBTJH0iQ.gif" /></figure><p>And then, in order to connect the input, attach an <strong>On-Screen Button</strong> component to the button images and select the same control path from above:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*pf5O8oHAPMhNsyN_2bMB_w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*H8t5IFgJ-ZBrXC7Skzz_Wg.gif" /></figure><p>And that’s it, we used the new input system to implement mobile controls with Unity! :D. I’ll see you in the next post, where I’ll be showing how to implement mobile ads for our game with Unity.</p><blockquote><em>If you want to know more about me, feel free to connect with me on </em><a href="https://www.linkedin.com/in/fas444/"><strong><em>LinkedIn</em></strong></a><strong><em> </em></strong><em>or visit my </em><a href="http://fernandoalcasan.com/"><strong><em>website </em></strong></a><em>:D</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b76545a4aa0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OnClick Events | Unity]]></title>
            <link>https://fas444.medium.com/onclick-events-unity-f4805203b039?source=rss-bc9ab25c021f------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4805203b039</guid>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[gamedev]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[gamedevhq]]></category>
            <dc:creator><![CDATA[Fernando Alcantara Santana]]></dc:creator>
            <pubDate>Thu, 11 Nov 2021 18:06:36 GMT</pubDate>
            <atom:updated>2021-11-24T05:46:05.611Z</atom:updated>
            <content:encoded><![CDATA[<h4>Unity Guide</h4><h4>A quick guide about how to work with OnClick events with Unity</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tdRkJqWm2UNIlFDsYTU1wg.gif" /></figure><p><strong>Objective</strong>: Use OnClick events to display information with UI elements in a 2D game with Unity.</p><p>In the last post I covered <a href="https://medium.com/nerd-for-tech/creating-a-loot-system-unity-27476f9948be">how to create a loot system with Unity.</a> Now, it’s time to work with the OnClick events from the UI elements in order to display information to the user according to what it selects in the shop.</p><h3>The shop</h3><p>To start, let’s take a look at the current shop of our 2D game. Currently, we have 3 items on sale:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5H-brVDP0989nnBBVabejw.png" /></figure><p>We’re using a Canvas to display the UI elements from the shop. Right now, we have a button for each one of the items on sale:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*Gt5M3IJ3nbrXzL7clKOqog.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*bdR64cY3Qhfy0zdVftsCzQ.png" /></figure><h4>New input system</h4><p>Also, as we’re using the “new” input system from Unity, we’ll need to replace the <strong>Standalone input module</strong> component from the<strong> EventSystem</strong> gameobject that gets created every time that we create a Canvas in our scenes. This way, we’ll be able to click on each button without trouble.</p><blockquote>Note: If you’re using the legacy input system just skip this step.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*BsC7pYOMyqUvgo_WFtyGGg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*_hCDw5xLFLTZjZeXVuWNWA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*BzukA3oka9fz9z0HEiz93A.gif" /></figure><h3>Creating the shop mechanic</h3><p>And now, let’s start by creating the shop mechanics within a new C# script:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*MwHtXeW4Jv_tziJ4XhJOLw.gif" /></figure><p>Once created, let’s import the <strong>UI</strong> namespace from the <strong>UnityEngine </strong>library to be able to handle UI elements from our code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*aeOIdIUnB2EIWAGK4_hsSg.png" /></figure><p>Then, let’s create a couple of new variables to have a reference of the dialog text and the item image from the shop. Don’t forget to use <strong>[SerializeField]</strong> with private variables to be able to drag the reference to the inspector:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*W02CSTH2GoV1mAD4rpD_fA.png" /></figure><p>Next, let’s create a new public method that will receive an scriptable object of type <strong>Item </strong>as a parameter. Then, we’ll use it to change the text from the dialog box and the respective image when an item gets selected:</p><blockquote>Note: We could receive other information as a parameter to reach our goal, but we’re using scriptable objects as they’re a good way to store information.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*F1kggXJymNlnh9GoFKC-vw.png" /></figure><p>The scriptable object of type <strong>Item </strong>contains the next information:</p><ul><li>Name</li></ul><p>This property will store the name of our item. We use the <strong>new</strong> keyword before name to avoid naming troubles as Unity uses the <strong>name</strong> keyword to store the name of each gameobject created.</p><ul><li>Cost</li></ul><p>This property will store the value in diamonds of the item.</p><ul><li>Image</li></ul><p>This property will store the respective sprite from the item.</p><ul><li>Description</li></ul><p>This property will store the description of the item.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*cww7J4MGk4x1EyJNvAh_dA.png" /></figure><p>So, with the scriptable object defined, let’s create one for each item in our store and define the respective properties through the inspector:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*U4Buba5La_80nxLOWXMvMA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*f6mfGcCe8bhHJbMjqPB9pg.png" /></figure><p>Then, let’s attach the <strong>Shop</strong> script into the shop gameobject:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_GVg2CBjGq7TLkmiLIM6vw.png" /></figure><p>Once attached, let’s drag the references of the UI elements to the inspector:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*fGkcXJJva48JnFfFzcdwuQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*jXUI7g7o_htza_HITxylQw.gif" /></figure><h3>Using the OnClick events</h3><p>And now, in order to display the respective information when we click the buttons of the shop, let’s use the OnClick events from the UI buttons to call the respective method in the <strong>Shop </strong>class.</p><p>To use them, let’s:</p><ul><li>Select the buttons and add an OnClick event in the button component.</li><li>Drag the shop<strong> </strong>gameobject (with the <strong>Shop </strong>class component) to the OnClick event.</li><li>Select the method we created when the button gets selected.</li><li>Drag the respective scriptable object into the OnClick event to be sent as a parameter.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*OnsWcU8wNbV-RdXCJMcLAw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*40904LJeoL3CqE3dWpnlaw.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*pL-3d6eEgPS1Y_ZJeC0hww.gif" /></figure><p>And now, if we run the game with Unity, we’ll see that the description and image UI elements change when we click on each of the buttons:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i0VQBbIzO93HRRIMXK94_w.gif" /></figure><p>And that’s it, we used the OnClick events from the UI elements to display information with Unity! :D. I’ll see you in the next post, where I’ll be showing how to implement cross-platform input in our game with Unity.</p><blockquote><em>If you want to know more about me, feel free to connect with me on </em><a href="https://www.linkedin.com/in/fas444/"><strong><em>LinkedIn</em></strong></a><strong><em> </em></strong><em>or visit my </em><a href="http://fernandoalcasan.com/"><strong><em>website </em></strong></a><em>:D</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4805203b039" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a loot system | Unity]]></title>
            <link>https://fas444.medium.com/creating-a-loot-system-unity-27476f9948be?source=rss-bc9ab25c021f------2</link>
            <guid isPermaLink="false">https://medium.com/p/27476f9948be</guid>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[gamedevhq]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[gamedev]]></category>
            <category><![CDATA[unity]]></category>
            <dc:creator><![CDATA[Fernando Alcantara Santana]]></dc:creator>
            <pubDate>Mon, 08 Nov 2021 17:53:22 GMT</pubDate>
            <atom:updated>2021-11-09T03:17:36.303Z</atom:updated>
            <content:encoded><![CDATA[<h4>Unity Guide</h4><h4>A quick guide about how to create a simple loot system in Unity</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8xlCgFNI0iQzgBTZdeDdtA.gif" /></figure><p><strong>Objective</strong>: Create a loot system for the player to collect diamonds in a 2D game with Unity.</p><p>In the last post I covered <a href="https://medium.com/nerd-for-tech/implementing-hitbox-detection-for-melee-combat-unity-bc1912178e63">how to implement a hitbox detection system with Unity</a>. Now, it’s time to create a loot system in order for our player to be able to collect diamonds in our 2D game.</p><h4>Current state</h4><p>To start, let’s take a look at the current state of our 2D game. Currently, we can attack and receive attacks from the enemies:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qz27KGxRGdMnVR5Nz595BA.gif" /></figure><p>Also, we already have several diamonds across the environment that we’ll be able to collect with the loot system:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xoPXG9yaAXkuaniLguk8-g.png" /></figure><h3>Creating the diamonds</h3><p>In order to introduce the respective diamonds we sliced a sprite sheet that contains the diamond sprite with an animation using the 2D sprite editor:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*h-c6By2DtwfAoYdCyhCUsQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*jXShrq-6HW8j7TicjdXBZA.png" /></figure><p>Then, we created a new gameobject with the next components:</p><ul><li>Sprite Renderer</li><li>Animator</li><li>Rigidbody 2D</li></ul><p>The gravity scale is set to 0 so that the diamond doesn’t fall and remains on its position.</p><ul><li>Circle Collider 2D</li></ul><p>The <strong><em>Is Trigger</em></strong> property is enabled to check when the player collides with the diamond and handle what to do when that happens in the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*FsbuGyz9qJrW7dZtJiZDRA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*1NMnDbkxLGwWRZnODzx0gQ.png" /></figure><p>Once we have those components we can turn the gameobject into a prefab and put them across the 2D environment as we wish:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*auPDdN3XQWp47gGI4LnExA.png" /></figure><h3>Creating the loot system</h3><p>Now, in order to create our loot system, let’s start by creating a new C# script that we’ll attach to the diamond prefab:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*iDhXH4VrwdZNXB0LzF67EA.png" /></figure><p>Once created, let’s open the script and:</p><ul><li>Include the <strong>System </strong>namespace at the top.</li><li>Tell the script to require a Rigidbody 2D and a Collider 2D to avoid having to check if these components are included in the gameobject.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*s3LQ1hQPNaHNBts9BqY_Sg.png" /></figure><p>Then, let’s create a new public static Action delegate that will serve as a way to notice each time that a diamond gets collected:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*OWMbOwH660EgdAGhy8OUkw.png" /></figure><p>If you want to know more about Action delegates you can visit the Microsoft docs:</p><p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.action?view=net-5.0">Action Delegate (System)</a></p><p>Then, let’s use the OnTriggerEnter2D method to check when another collider collides with the diamonds. Once that happens let’s:</p><ul><li>Check if the tag from the other collider belongs to the player (as we want the player to collect the diamonds).</li><li>Check if the Action delegate has someone subscribed to the event to execute it.</li><li>Destroy the diamond gameobject.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*_IhgFzm-hzFROp4ORsmJmg.png" /></figure><h4>Player script</h4><p>Once we attached the Diamond script to the prefab, let’s open the Player script and create a new variable that will keep the count of the diamonds collected:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*-qQGQ__X-9UdPIG1d2ErwA.png" /><figcaption>Use <strong>[SerializeField]</strong> or a <strong>public </strong>variable to be able to see when a diamond gets collected through the inspector.</figcaption></figure><p>Finally, let’s use the <strong>Start </strong>or <strong>Awake </strong>method to subscribe the player to the Action delegate from the Diamond script. This way we can use an anonymous method that will add a single diamond to the variable we created:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*v8ggYXbEsUzXGMOxadC6YA.png" /></figure><p>For more reference about the anonymous methods you can visit the Microsoft docs:</p><p><a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/lambda-expressions">Lambda expressions - C# reference</a></p><p>And now, if we run the game in the Unity editor, we’ll see that the diamonds get collected when the player collides with them:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MDBqYPns2iAOQ0-jL7hhPw.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*Dli9H7AKXF-3M7TNHKBwuA.gif" /><figcaption>The value of the diamonds variable changes each time that a diamond gets collected.</figcaption></figure><p>And that’s it, we created a loot system that allows the player to collect diamonds in our 2D game with Unity! :D. I’ll see you in the next post, where I’ll be showing a tutorial about UI events in Unity.</p><blockquote><em>If you want to know more about me, feel free to connect with me on </em><a href="https://www.linkedin.com/in/fas444/"><strong><em>LinkedIn</em></strong></a><strong><em> </em></strong><em>or visit my </em><a href="http://fernandoalcasan.com/"><strong><em>website </em></strong></a><em>:D</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27476f9948be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing hitbox detection for melee combat | Unity]]></title>
            <link>https://fas444.medium.com/implementing-hitbox-detection-for-melee-combat-unity-bc1912178e63?source=rss-bc9ab25c021f------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc1912178e63</guid>
            <category><![CDATA[gamedev]]></category>
            <category><![CDATA[gamedevhq]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[games]]></category>
            <dc:creator><![CDATA[Fernando Alcantara Santana]]></dc:creator>
            <pubDate>Fri, 15 Oct 2021 14:55:23 GMT</pubDate>
            <atom:updated>2021-10-16T06:45:28.758Z</atom:updated>
            <content:encoded><![CDATA[<h4>Unity Guide</h4><h4>A quick guide about how to implement a system to identify hitboxes during a melee combat in Unity</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yYU-ESUYG2BqVzzebHNijA.gif" /></figure><p><strong>Objective</strong>: Implement a system to detect the hitbox of damageable gameobjects during a melee combat in a 2D game with Unity.</p><p>In the last post I covered <a href="https://fas444.medium.com/idamageable-interface-unity-45bf961d141">how to implement an IDamageable interface in Unity</a>. Now, it’s time to implement a system to identify the hitboxes of damageable gameobjects during a melee combat in order to apply damage to them.</p><p>If you haven’t seen the last post please take a moment to check it out as it’s an essential component for the hitbox detection mechanic:</p><p><a href="https://fas444.medium.com/idamageable-interface-unity-45bf961d141">IDamageable interface | Unity</a></p><h3>Attack point</h3><p>In order to start developing our hitbox detection system let’s create a new gameobject within our player that will represent the origin of the sword attack:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*HwQt5YjVdkT4GMyeDFMIBw.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*C0ZKiFP-H_invmjpS85LEA.gif" /></figure><p>If we play the attack animation we’ll see that the point is at the center of the attack:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*rrB9gGx96tAuQjWfK3Hi1A.gif" /></figure><h3>Enemy layer</h3><p>Then, in order to maintain order and simplicity when identifying the hitboxes, let’s create a new layer for the enemies of our game:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*obeCLg7QKp5T2fYpoU3vrg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*cldQvlRtKiHRqPbGP6w1Jg.gif" /></figure><h3>Attack range</h3><p>Next, in order to determine the range of our attack, let’s open the player script and create the next variables:</p><ul><li>Attack point</li></ul><p>This variable will store a reference to the attack origin Transform in order to know the position of each attack.</p><ul><li>Attack range</li></ul><p>This variable will determine the range of our attack starting from the attack origin.</p><ul><li>Attack mask</li></ul><p>This variable will indicate in which layers we’ll identify colliders when executing an attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*EbmlDkdV9HRlF2mcei3hHw.png" /></figure><p>In case that we want to visualize the attack range, we can make use of our variables within the <strong>Gizmos.DrawWireSphere</strong> method at the <strong>OnDrawGizmos</strong> method:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*30HfzbkzfnwLR7LwASUOkg.png" /></figure><p>Once we assign the respective values for the variables through the inspector we’ll be able to visualize the attack range at the Scene view:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*DVeOpPrGHnE8kWFsSk9WVw.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*HVcQc2QacSrI_iFG3pNe3w.gif" /></figure><p>This way, everything inside our range will be affected by our attack when we execute it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uuVeFW2lw_6dUR5h5fF1yQ.gif" /></figure><h3>Identifying the hitboxes</h3><p>And now, in order to identify the hitboxes inside our attack range, let’s create a new method in the player script where we’ll:</p><ul><li>Store all the colliders within the attack range by using the <strong>Physics2D.OverlapCircleAll </strong>method with the respective parameters (attack origin, range and layer mask).</li><li>Search for the <strong>IDamageable </strong>component in each collider to know if it’s damageable.</li><li>If that’s the case, call the <strong>Damage </strong>method from the component to apply the respective damage.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5CGdwqAQof8r3YURVxIGPA.png" /></figure><p>If we take a look at the <strong>Damage </strong>method (that is implemented in the enemy script thanks to the <strong>IDamageable </strong>interface) we’ll see that it subtracts a unit from the health and triggers the respective animations:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*GgGu86yknZbnoUzdr1JEjA.png" /></figure><p>Finally, in order to execute our <strong>Attack </strong>method, let’s open the Animation window and call it through an <strong>animation event </strong>at the exact frame where the sword is attacking in the attack animation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oza1fE7MJvyjTs_bLyE-YQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*WpnzArf-9aJ-eDyXkiI0OA.gif" /></figure><p>If we run the game in Unity we’ll be able to see that the attacks are executed with the expected result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ofOinCeueheGZGZnPG9CDg.gif" /></figure><p>And that’s it, we implemented a system to detect hitboxes during melee combat in Unity! :D. I’ll see you in the next post, where I’ll be showing how to create a loot system in Unity.</p><blockquote><em>If you want to know more about me, feel free to connect with me on </em><a href="https://www.linkedin.com/in/fas444/"><strong><em>LinkedIn</em></strong></a><strong><em> </em></strong><em>or visit my </em><a href="http://fernandoalcasan.com/"><strong><em>website </em></strong></a><em>:D</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc1912178e63" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IDamageable interface | Unity]]></title>
            <link>https://fas444.medium.com/idamageable-interface-unity-45bf961d141?source=rss-bc9ab25c021f------2</link>
            <guid isPermaLink="false">https://medium.com/p/45bf961d141</guid>
            <category><![CDATA[gamedev]]></category>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[gamedevhq]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[unity]]></category>
            <dc:creator><![CDATA[Fernando Alcantara Santana]]></dc:creator>
            <pubDate>Thu, 14 Oct 2021 14:27:44 GMT</pubDate>
            <atom:updated>2021-10-15T03:35:11.100Z</atom:updated>
            <content:encoded><![CDATA[<h4>Unity Guide</h4><h4>A quick guide about how to implement an IDamageable interface in Unity</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZkmOs-wtHOp9gbakV6uZOg.gif" /></figure><p><strong>Objective</strong>: Implement an IDamageable interface in the enemies of a 2D game to indicate that they have health and are damageable.</p><p>In the last post I covered <a href="https://medium.com/nerd-for-tech/using-abstract-classes-to-design-enemies-unity-60c39c793a66">how to use abstract classes to design enemies in Unity.</a> Now, it’s time to work with interfaces in order to let the player know that the enemies are damageable.</p><h3>Current enemies</h3><p>To start, let’s take a look at the enemies in our 2D game. Currently, we have a moss giant, a spider and a skeleton that patrol on certain areas of the level:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4YgXabWtYpxKMscGACR29A.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KVMUixUr2S0J-tOFGz9veQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OLQMRtmxjGZla2prhnNv-Q.gif" /></figure><h3>IDamageable interface</h3><p>Now, in order to indicate that certain gameobjects are damageable (like our enemies), let’s create a new C# script named IDamageable:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*y2AS9lYHakRsxsLdwxM60g.gif" /></figure><p>Once created, let’s open the script and modify the IDamageable class to be of type interface:</p><blockquote>Note: An <strong>IDamageable</strong> <strong>interface </strong>will allow us to <strong>force </strong>certain classes to implement <strong>properties </strong>and/or <strong>methods </strong>that are needed to handle damage.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*Ue2aX1pGiM5Fi2VV0lb5iw.gif" /></figure><p>Then, let’s declare a new property and a method to handle the damage in certain classes like the enemies:</p><ul><li>Health</li></ul><p>This property will determine the amount of health that each class will have.</p><ul><li>Damage</li></ul><p>This method will take care of the damage application to the health within the class.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*hWYQGWy8h9IfScGHnByXdg.png" /></figure><p>Once we save the interface, let’s open the class of an enemy and make sure to declare that it’s damageable by implementing the <strong>IDamageable </strong>interface:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*wnxCNte4zpKR1Xzw5ultuw.gif" /></figure><p>You’ll notice that the class displays an error as soon as we declare that the class implements the interface:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*PmIqQT29bsVOmTy1xHOJyA.png" /></figure><p>This is due to the requirements of implementing the <strong>IDamageable </strong>interface. To fix it, we need to declare the respective health property and damage method within the class:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*U3jgKvHra2aNhv0KNEQ3pw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*vVSuIoXiIMTG4drOcz5TOA.png" /></figure><p>Once declared, we’ll see that the error disappears from the script. Then, let’s do the same to the other enemy classes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*sjTh2EcVf6ytShpbEl39mA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*kuu3Yx7tFnYJLx9rf89-cA.png" /></figure><p>And now, we’re able to declare what to do in each one of our enemies. For example, we can subtract a unit from the <strong>Health </strong>property in the <strong>Damage </strong>method:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*wdVWqIp5A-kdpO9xkfmtng.png" /></figure><p>This interface implementation allows us to call the <strong>Damage </strong>method without restrictions on what we want to damage in an attack. We could implement this interface in a wood box, an enemy or even the player. To use it, for example, we can get the <strong>IDamageable </strong>component from the collider on a collision and call the <strong>Damage </strong>method:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*dpiyd9ZOibL7xZSHPqgmBw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qq1MsP6DrmFaKop3wTieaw.gif" /></figure><p>And that’s it, now we can use an interface to indicate that our enemies are damageable in Unity! :D. I’ll see you in the next post, where I’ll be showing a way to implement the hitbox detection within melee combat in Unity.</p><blockquote><em>If you want to know more about me, feel free to connect with me on </em><a href="https://www.linkedin.com/in/fas444/"><strong><em>LinkedIn</em></strong></a><strong><em> </em></strong><em>or visit my </em><a href="http://fernandoalcasan.com/"><strong><em>website </em></strong></a><em>:D</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45bf961d141" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using abstract classes to design enemies | Unity]]></title>
            <link>https://fas444.medium.com/using-abstract-classes-to-design-enemies-unity-60c39c793a66?source=rss-bc9ab25c021f------2</link>
            <guid isPermaLink="false">https://medium.com/p/60c39c793a66</guid>
            <category><![CDATA[gamedev]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[unity3d]]></category>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[gamedevhq]]></category>
            <dc:creator><![CDATA[Fernando Alcantara Santana]]></dc:creator>
            <pubDate>Thu, 07 Oct 2021 14:16:15 GMT</pubDate>
            <atom:updated>2021-10-09T13:40:33.558Z</atom:updated>
            <content:encoded><![CDATA[<h4>Unity Guide</h4><h4>A quick guide about how to use an abstract class to implement enemies in Unity</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b1G2BdnQG9BGWTOom7Q6nw.gif" /></figure><p><strong>Objective</strong>: Use abstract classes to implement enemy mechanics in a 2D game with Unity.</p><p>In the last post I covered <a href="https://medium.com/nerd-for-tech/implementing-a-jump-mechanic-unity-6420b106e47a">how to implement a jump mechanic for our player with Unity</a>. Now, it’s time to start implementing the enemy mechanics in our 2D game by using an abstract class or virtual methods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*njeRLLj_yakdlIMWBwD1Xg.png" /></figure><h3>Creating the enemies</h3><h4>Sprites</h4><p>To start, let’s create a couple of new gameobjects with a sprite to represent the new enemies of our game. For our purpose, we’ll be using the sprite of a spider and a moss giant:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iwTYspLvDLIdZnQutk2w9w.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*RZBxM5iPu6U-DdOY7UV9Vw.png" /></figure><h4>Classes</h4><p>Then, in order to implement our enemies by using an abstract class, let’s create 3 new C# scripts:</p><ul><li>Enemy</li></ul><p>This class will be abstract and it will represent the base of every enemy subclass that we’ll use in our game.</p><ul><li>Moss Giant</li></ul><p>This subclass will inherit from the Enemy class and will handle the principal enemy mechanics and the moss giant mechanics.</p><ul><li>Spider</li></ul><p>This subclass will inherit from the Enemy class and will handle the principal enemy mechanics and the spider mechanics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*Im42yKOi-5FRGhK2e5ALBQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*ELRCYwWhGISl7bFbtEXb1g.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*GqC7Du_4XdbBid-SLm8wuA.gif" /></figure><p>Now, in order to indicate that the <strong>Enemy </strong>class will be the base of the enemy subclasses, let’s:</p><ul><li>Open the <strong>Enemy </strong>script and add the <strong><em>abstract </em></strong>keyword:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*KoMbyKXR_wZRyailkt6dRA.gif" /></figure><blockquote>Note: It’s important to indicate that the <strong>Enemy </strong>class is <strong>abstract</strong> so that we can create abstract methods in it.</blockquote><ul><li>Open the <strong>MossGiant </strong>and <strong>Spider </strong>classes and change the inheritance from <strong>MonoBehaviour </strong>to <strong>Enemy</strong>:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*mwtBCuT4gngnS2mID_wo5g.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*dXyaIK2gqYks1onbJyuHzQ.png" /></figure><h4>Variables</h4><p>And now, as we know that each enemy subclass inherits from the <strong>Enemy</strong> class, we can create new variables that we know that every enemy will need to have (like health, speed or gems that it will drop when it gets defeated):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*O_Ssk8vnJk7GqyDK7haFiA.png" /><figcaption>Don’t forget to use <strong>[SerializeField]</strong> to be able to modify the values through the inspector.</figcaption></figure><blockquote>Note: We’ll need to set the variables as <strong>protected </strong>(or <strong>public</strong>) to be able to read and use the variables within the enemy subclasses.</blockquote><p>This way we’ll be able to attach the respective scripts to our enemies and modify its values through the inspector:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*_tJTC_ja5EEqR-KfkI8AHg.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*Cj9b1TfQCSlPzHRgDt9WHg.gif" /></figure><h4>Virtual methods</h4><p>And now, let’s implement a method that each enemy could implement from the base class: <strong>Attack</strong>. By using a virtual method we’re able to use or overwrite it within the enemy subclasses. Let’s declare the <strong>virtual Attack </strong>method and print a message when it’s called:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*h4UwgTw5GTKtwoaiUs2j4A.png" /></figure><p>Then, let’s declare the <strong>override Attack</strong> method within the enemy subclasses. With the override keyword we’re able to overwrite the method from the <strong>Enemy </strong>base class or also call it within the new implementation by using the <strong>base.Attack</strong> line:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*zyvBtiW_UcvbgUmaUJSgJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*WTA8D-EmaT33W4Cc4c9O5Q.png" /></figure><p>Now, in order to see how the virtual methods work, let’s use the <strong>Start </strong>method within the <strong>Enemy </strong>subclasses to call the <strong>Attack </strong>method:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*la0O6TAGZkydOJNBgwVaYQ.png" /></figure><p>If we run the game with Unity, we’ll be able to see that the <strong>Attack </strong>method from the <strong>Enemy </strong>base class gets called first (thanks to <strong>base.Attack</strong>) and then the attack method from the subclasses continue with the execution:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*1cWB7jjbtxfYME5zbS7Bvg.png" /></figure><h4>Abstract methods</h4><p>Finally, let’s implement an abstract method for our base class. An abstract method implies that it’s mandatory to implement the same method within its subclasses. So, for example, let’s implement the <strong>Update </strong>method as an abstract method:</p><blockquote>Note: When we declare an <strong>abstract </strong>method within our <strong>abstract </strong>class, we can’t define any functionality.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*mn7LpcvOB1W57wqK0T1Khg.png" /></figure><p>Once <strong>Update </strong>is declared as an abstract method we’ll be able to see that the compiler displays an error within the subclasses of <strong>Enemy:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PGKBA_xv6NVyBNI2Nu6MPg.png" /></figure><p>This error gets displayed because we should implement the <strong>Update </strong>method mandatorily in the subclasses. So, in order to fix it, let’s implement the <strong>override Update </strong>method in the <strong>MossGiant </strong>and <strong>Spider </strong>subclasses:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*DpJijL568vIhfQg_-XDsaQ.png" /></figure><p>This way we can make sure that each enemy that we create implements the <strong>Update </strong>method mandatorily. By using abstract classes or virtual methods we’re able to deliver a functional and organized set of classes that use similar mechanics like the enemies of our game.</p><p>And that’s it, we used abstract classes to implement enemy mechanics with Unity! :D. I’ll see you in the next post, where I’ll keep working in the development of our 2D game with Unity.</p><blockquote><em>If you want to know more about me, feel free to connect with me on </em><a href="https://www.linkedin.com/in/fas444/"><strong><em>LinkedIn</em></strong></a><strong><em> </em></strong><em>or visit my </em><a href="http://fernandoalcasan.com/"><strong><em>website </em></strong></a><em>:D</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60c39c793a66" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing a jump mechanic | Unity]]></title>
            <link>https://fas444.medium.com/implementing-a-jump-mechanic-unity-6420b106e47a?source=rss-bc9ab25c021f------2</link>
            <guid isPermaLink="false">https://medium.com/p/6420b106e47a</guid>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[gamedev]]></category>
            <category><![CDATA[gamedevhq]]></category>
            <category><![CDATA[unity-game-development]]></category>
            <dc:creator><![CDATA[Fernando Alcantara Santana]]></dc:creator>
            <pubDate>Wed, 29 Sep 2021 18:12:34 GMT</pubDate>
            <atom:updated>2021-09-30T01:37:48.111Z</atom:updated>
            <content:encoded><![CDATA[<h4>Unity Guide</h4><h4>A quick guide about how to implement a jump mechanic in Unity</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TgPqbgL-lnghrHR2d_wy2w.gif" /></figure><p><strong>Objective</strong>: Implement a jump mechanic for a 2D player using a Rigidbody2D.</p><p>In the last post I covered <a href="https://medium.com/nerd-for-tech/moving-with-the-new-input-system-unity-a6c9cb100808">how to implement movement with the new Unity’s input system</a>. Now, it’s time to implement a jump mechanic for our player with a Rigidbody2D component within a 2D environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5tho1mFdJxTQFQoRxw5fOw.png" /></figure><h3>Creating the jump action</h3><p>To begin, let’s create the jump action within our input actions asset. Let’s keep the action type as a <strong><em>Button</em></strong> as we’re going to implement a jump mechanic that gets triggered:</p><blockquote>Note: If you don’t know how to start using the new input system in Unity, take a look at my <a href="https://medium.com/nerd-for-tech/moving-with-the-new-input-system-unity-a6c9cb100808">last post</a>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rYDEbjUU5-6D-r5SRdCi5w.gif" /><figcaption>In the last post I created an action to control the movement of the player.</figcaption></figure><p>Then, let’s select the default binding and indicate that the space key from the keyboard will bind with the jump action:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IeE9074S28u-goQs3z68jw.gif" /></figure><h3>Creating the ground layer</h3><p>Next, in order to be able to identify when the player is grounded, and therefore, allow the jump mechanic to be performed, let’s select the respective ground tilemap and change its layer:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*HZVD-VfWCU9drwxS8DG6Dw.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*QHeLf2Ucr2bkKrqcWMcQ4A.gif" /></figure><h3>Implementing the jump mechanic</h3><h4>Variable declaration</h4><p>And now, in order to implement the jump mechanic, let’s open the player script and declare the next variables:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*pPrgajf89kpqLA2TuQk0QA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*40SsEGvfk4Hdev9O0lyKow.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*wHeTZnm25dz_5brT3ILWQw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*K10Qz52A6otPlp0Pl7SjTg.png" /></figure><ul><li>Jump power</li></ul><p>This variable will determine the initial velocity to apply when jumping.</p><ul><li>Jump fall gravity multiplier</li></ul><p>This variable will determine the gravity scale applied to the Rigidbody when the player is falling after performing a jump.</p><ul><li>Ground check height</li></ul><p>This variable will determine the height of the box (<strong>OvelapBox </strong>method) that we’ll be using below the player to determine if the it’s on the ground or not.</p><ul><li>Ground mask</li></ul><p>This variable will allow us to check for colliders that are within the ground layer when using the <strong>OverlapBox </strong>method.</p><ul><li>Disable ground check time</li></ul><p>This variable will determine how much time does the ground check gets disabled when jumping in order to avoid resetting the jumping bool value.</p><ul><li>Box center</li></ul><p>This variable will indicate the central coordinate of the box that checks if the player is on the ground or not.</p><ul><li>Box size</li></ul><p>This variable will indicate the size (width, height) of the same box.</p><ul><li>Jumping</li></ul><p>This variable will indicate if the player is currently jumping.</p><ul><li>Initial gravity scale</li></ul><p>This variable will store the initial gravity scale value of the Rigidbody.</p><ul><li>Ground check enabled</li></ul><p>This variable will indicate if the ground check is enabled or not.</p><ul><li>Wait</li></ul><p>This variable will be used to wait within a coroutine before enabling the ground check again.</p><ul><li>Rigidbody</li></ul><p>This variable will hold a reference to the Rigidbody2D of our player.</p><ul><li>Player actions</li></ul><p>This variable will hold a reference to the input action asset that contains the player actions like moving or jumping.</p><ul><li>Collider</li></ul><p>This variable will hold a reference to the Box Collider 2D of our player.</p><h4>Variable initialization</h4><p>Then, in the <strong>Awake </strong>method, let’s initialize the variables and the references we need to implement the jump mechanic. The last line subscribes the <strong>Jump_performed </strong>method to the <strong>performed </strong>event of the <strong>Jump </strong>action from the input action asset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*jm16X5-pl1U7jl5OAyrsjQ.png" /></figure><p>Also, let’s make sure to enable and disable the respective action map (to receive the input from the user) within the <strong>OnEnable </strong>and <strong>OnDisable </strong>method as good practices:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*dmZoC41Xmm7k9yH4eyf1eA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*k9rWRN7Nm9ZuDHjt_VrwcQ.png" /></figure><h4>Implementing the jump</h4><p>Now, in order to implement the jump, let’s use the next methods and coroutines:</p><p><strong>Jump_performed</strong></p><p>This method will be called each time that the player performs the <strong><em>Jump </em></strong>action (which is bound to the space key). First, we’ll check if the player is on the ground by calling the <strong>IsGrounded </strong>method. If that’s the case, we’ll add velocity to the Y axis (according to the jump power of the player) and set the jumping bool value to true. Finally, we’ll start a coroutine to disable and enable the ground check to avoid resetting the jumping bool value while starting the jump.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*LKaR5MvpwcTrOkBd8dQaKA.png" /></figure><p><strong>IsGrounded</strong></p><p>This method will return a bool value to indicate if the player is on the ground or not. To check this we’ll need to:</p><ul><li>Calculate the central coordinate of the box by adding up: the central coordinate of the collider, the half of the height of the collider (negative) and the half of the height from the new box (negative) that checks if the player is on the ground.</li><li>Set the size of the new box within a Vector2 to have the same width of the collider and the height desired.</li><li>Use the <strong>OverlapBox </strong>method by sending as parameters the center coordinate of the new box, the size of the new box, the angle of the new box and the respective ground layer mask.</li><li>If the collider returned isn’t null, the player is on the ground, otherwise, it isn’t on the ground.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9wI85q40JiJ6bf5F3c4NhQ.png" /></figure><p><strong>EnableGroundCheckAfterJump</strong></p><p>This coroutine will change the bool value that indicates that the ground check should be “disabled” or “enabled”. This is intended to disable the ground check for some time (indicated by the user) after each jump so that the bool value that indicates when the player is jumping doesn’t change when the player is still on the ground for the initial frames.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*utTJt08Xr_56j62ajt_tKw.png" /></figure><h4>Polishing the jump</h4><p>And now, in order to improve the jump execution, let’s create a new method that will be called in the <strong>FixedUpdate </strong>method to determine when the player isn’t jumping anymore and to change the gravity scale when it’s falling respectively:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*cvYUV97Oz81oN6QaRWpTTg.png" /></figure><p>Then, let’s add it into the <strong>FixedUpdate </strong>method after the lines that apply the movement:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*EbiWvySgseL2VX8IDbXHmA.png" /></figure><h4>Visualizing the ground check</h4><p>Next, in order to visualize the box that checks if there’s ground below the player, let’s use the <strong>Gizmos.DrawWireCube</strong> method with the respective coordinate and size inside the <strong>OnDrawGizmos </strong>method:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*t7Psh8TZ9RO4Q0zLOuovBA.png" /></figure><blockquote>Note: This will be visible only in the <strong>Scene </strong>window of the <strong>Unity Editor</strong>.</blockquote><h4>Customizing properties</h4><p>Finally, to start using the jump mechanic, let’s modify the values of the jump and ground check properties through the inspector:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*CsQ-spGrEwbd2Zl-Qk3SOQ.gif" /></figure><p>If we run the game with Unity, we’ll see that the ground check works and more gravity gets applied after reaching the apex of the jump:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*067RssWsDH1DFDW6l9fnkA.gif" /></figure><p>And that’s it, we implemented a reliable jump mechanic for our player with Unity! :D. I’ll see you in the next post, where I’ll be showing how to implement more mechanics for our player with Unity.</p><blockquote><em>If you want to know more about me, feel free to connect with me on </em><a href="https://www.linkedin.com/in/fas444/"><strong><em>LinkedIn</em></strong></a><strong><em> </em></strong><em>or visit my </em><a href="http://fernandoalcasan.com/"><strong><em>website </em></strong></a><em>:D</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6420b106e47a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Moving with the new input system | Unity]]></title>
            <link>https://fas444.medium.com/moving-with-the-new-input-system-unity-a6c9cb100808?source=rss-bc9ab25c021f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6c9cb100808</guid>
            <category><![CDATA[unity2d]]></category>
            <category><![CDATA[gamedev]]></category>
            <category><![CDATA[gamedevhq]]></category>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[unity]]></category>
            <dc:creator><![CDATA[Fernando Alcantara Santana]]></dc:creator>
            <pubDate>Fri, 24 Sep 2021 19:34:35 GMT</pubDate>
            <atom:updated>2021-09-25T00:22:58.393Z</atom:updated>
            <content:encoded><![CDATA[<h4>Unity Guide</h4><h4>A quick guide about how to implement movement using the new input system in Unity</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VHC3roNUAJAby6lXVHkjMw.gif" /></figure><p><strong>Objective</strong>: Set up horizontal movement for our player using the new input system in Unity within a 2D game.</p><p>In the last post I covered <a href="https://medium.com/nerd-for-tech/animated-tiles-unity-a9fa47103296">how to introduce animated tiles for our game with Unity</a>. Now, it’s time to begin setting up the player by implementing a simple horizontal movement mechanic using the new input system in Unity.</p><h3>Player sprite</h3><p>To start, let’s take a look at the sprite sheets that we have for the player animations:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*ZAaeh_7WLD7x3HNYgIN9Hg.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*pwVmnd6Fjd7B-T7sTdpO4A.gif" /></figure><p>Then, to get the initial sprite of our player, let’s slice the <em>Idle </em>sprite sheet by using the sprite editor:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*KpPstjIW6VKG-bXT-68E_w.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*5ZsCUCtQp13vYKaKCuA4MA.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*I4lkh6SADjWyPPuFeNINVw.png" /></figure><p>Once sliced, let’s create a new empty gameobject to contain the initial player sprite so that it’s easier to manage all its components:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*20xxxsbn4q0bDQ589y508w.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*ZbL77K4EUa6ic1IEO2koig.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*JQ8g2RKJBVVoBH47aqGSzg.gif" /></figure><h3>Player Components</h3><p>Next, let’s create a new script and attach it to the player gameobject:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*dHq8Kghk2XPcKdSNba1HmA.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*MrsrMCB_4Pa4DfdGSvlezA.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*0NVIJomGledI_7rR8SkAdg.gif" /></figure><p>Also, in order to handle the player’s movement and collisions with the environment, let’s attach a Rigidbody 2D and a Box Collider 2D. Once attached, we can edit the 2D collider to match the sprite:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*z5CHMEKimOP5Ykf2ZjRtkw.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*z9ALo7UWVu8vY2UJvbDgTQ.gif" /></figure><h3>Importing the new input system</h3><p>And now, in order to be able to use the new input system from Unity, let’s:</p><ul><li><strong>Open</strong> the <strong>package manager</strong> by clicking on <em>Window &gt; Package Manager</em>.</li><li><strong>Select </strong>the <strong>Unity Registry</strong> packages at the top left.</li><li><strong>Find </strong>and <strong>install </strong>the <strong><em>Input System</em></strong> package by clicking on the Install button at the bottom.</li><li><strong>Wait </strong>until the package gets installed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*fZLsBSGseNZ-nri1mnkV7A.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uAhT5qUe-DuTo5YLdHHzpw.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*ph9SdbngAo-ITt0ZILYm0w.gif" /></figure><p>It’s probable that the next window will be prompted after the installation is completed. You can choose to disable the old input and enabling the new input system by clicking on <em>Yes </em>or just keep the same settings by clicking on <em>No</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*Uac-VBq28v4dzh1bOQqHag.gif" /></figure><p>If you choose to leave the old input and you want to change the input handling you can:</p><ul><li>Click on <em>Edit &gt; Project Settings</em> to <strong>open the project settings</strong>.</li><li>Go to the <strong><em>Player </em></strong>tab.</li><li>Scroll down to the <strong><em>Other Settings</em></strong> section.</li><li>Change the <strong><em>Active Input Handling</em></strong> property to use the new input system or both old and new system.</li></ul><blockquote>Note: The Unity Editor will restart to apply changes to this settings.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*VbJFlXHkUzX9azREWomOKw.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wwYe4x0RN-ngVtxhw4QaEA.gif" /></figure><h3>Movement input</h3><p>Once that the Unity Editor recognizes the new input system, let’s begin by creating a new <strong>input action asset</strong> to handle the inputs from the player. You can create one by clicking on <em>Create &gt; Input Actions</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*KAqCvrec6iW4hOvUc-GZrA.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/513/1*d4gHqEjN2mt9ni1WhceDew.gif" /></figure><p>Then, to modify the input action asset, let’s double click on its file or click on <strong><em>Edit asset</em></strong> through the inspector to open the respective window:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*-wNKuMveIrZwTcOEtL09LQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*SH186V1CAG3pGs6gLxQYbQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HraVx2SMg3ZYRXJF8th_6g.png" /><figcaption>In this window we’ll be able to determine the actions to execute according to what inputs we bind to them.</figcaption></figure><p>Once the window is prompted, let’s create a new action map to handle the gameplay actions from the player by clicking on the next button:</p><blockquote>An action map represents a collection of actions that can be enabled or disabled to use different inputs depending on what’s happening in the game. For example, we can have an action map enabled when the player is walking and another action map enabled when the player is driving a car.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fypy8heZSRnEK6Fp3kHENQ.gif" /></figure><p>Next, let’s modify the new action in our action map by:</p><ul><li>Indicating that it’s for movement.</li><li>Changing the <strong><em>Action Type</em></strong> property to be of type <strong>value</strong>.</li></ul><blockquote>An action of type value will be monitored continuously (to be able to read it’s value when it changes) while an action of type button will be acting as a trigger once that a button gets pressed.</blockquote><ul><li>Changing the <strong><em>Control Type</em></strong> to <em>Vector2 </em>in order to limit the input to be the X and Y axis values for our movement.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OzniK2npSI_orjCcJikRUQ.gif" /></figure><p>Then, in order to receive a <em>Vector2 </em>value from the inputs that will be bend to the movement action, let’s get rid of the default binding slot and create a new 2D Vector Composite:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pqt1oKza5kD_wpWQJjtznw.gif" /></figure><p>Now, to indicate the input keys to receive the Vector2 values, let’s click on each direction and select the key that we want to map. Additionally, we can click on the <strong>Listen </strong>button and then click on the key to let Unity detect which key needs to be selected:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7DakjOr91VDrqPJ358DNIw.gif" /></figure><p>Finally, don’t forget to click on the <strong>Save Asset</strong> button to save the changes we did to the input action asset:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DLAK8X8oVudwsUqHUjJZug.gif" /></figure><p>If you want to know more about the new Unity’s input system, you can visit the Unity docs:</p><p><a href="https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/QuickStartGuide.html">Quick start guide</a></p><h3>Receiving values from the input action asset</h3><p>And now, in order to receive the respective values from the movement action, let’s:</p><ul><li><strong>Click </strong>on the input action asset.</li><li><strong>Enable </strong>the <strong><em>Generate C# Class </em></strong>property through the inspector.</li><li><strong>Click </strong>on the <strong>Apply</strong> button to create the C# class.</li></ul><p>This will create a new C# class that will contain the input actions from the asset we modified. With this class, we’ll be able to keep track of the actions within MonoBehaviour components like our player’s script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*XmrH3MOy7dr0ro7NXtEpZg.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*iQrhfN0ZpfuYIw96SLyPGQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*BgodL2ilyq4EjMaAMEmfWw.png" /><figcaption>We’ll use this class to be able to use the actions from our input action asset.</figcaption></figure><p>For more information about how to create actions with the new input system, you can visit the Unity docs:</p><p><a href="https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/Actions.html#creating-actions">Actions</a></p><p>Once the <strong>PlayerActions </strong>class is generated, let’s open the <strong>Player </strong>script to implement the movement. We’ll need the next global variables to do it:</p><ul><li>Speed</li></ul><p>This variable will indicate the speed of the movement of our player.</p><ul><li>Player actions</li></ul><p>This variable will work as a reference to the new <strong>PlayerActions </strong>class where we’ll be able to receive the movement values from the inputs.</p><ul><li>Rigidbody</li></ul><p>This variable will hold a reference to the <strong>Rigidbody2D</strong> of our player.</p><ul><li>Move input</li></ul><p>This variable will store the current <strong>Vector2 </strong>value from the movement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*RKSHDLOmw7Yd5E053bJYjQ.png" /></figure><p>Then, in the <strong>Awake</strong> method, let’s initialize the respective references to the <strong>PlayerActions </strong>class and the<strong> Rigidbody2D</strong> component of the player:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*YQc-GcJQiBjX6DQBHVd3eg.png" /></figure><p>Next, we need to<strong> manually enable the action map</strong> (which contains the movement action) that the player will be using initially by using the <strong>OnEnable </strong>method:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*mwQUZmN4qV7CYGV7gnL_Nw.png" /></figure><p>Also, let’s disable it by using the <strong>OnDisable </strong>method as a matter of good practice when working with actions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*09NSmXYQcbc0hnqc0dZxpA.png" /></figure><p>Finally, let’s use the <strong>FixedUpdate </strong>method to implement the movement of our player by:</p><ul><li>Reading and storing the Vector2 value from the <strong>Movement action.</strong></li><li>Setting the Y axis value to 0 (temporal fix until we apply velocity on this axis).</li><li>Setting the <strong>velocity</strong> of the <strong>Rigidbody2D </strong>to be the input value multiplied by the speed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*HygObBiQt_3LQtTVJmnBtw.png" /></figure><h3>Testing the movement</h3><p>Before running the game, let’s:</p><ul><li><strong>Indicate </strong>a value to the <strong>speed </strong>variable of our player.</li><li><strong>Freeze </strong>the <strong>Z rotation</strong> of the <strong>RigidBody2D </strong>component (to avoid rotation while moving to the sides).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*3zvBC1tyDq3-luekhu8yGA.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*M1jytzjU7IzmqOwkSICMKg.gif" /></figure><p>And now, if we run the game with Unity, we’ll see that the player moves as expected:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TjnuAgJqY3GjDICksWz_rg.gif" /></figure><p>And that’s it, we used the new input system of Unity to implement the player’s movement! :D. I’ll see you in the next post, where I’ll be showing how to implement the player’s jump using the new input system and a Boxcast2D with Unity.</p><blockquote><em>If you want to know more about me, feel free to connect with me on </em><a href="https://www.linkedin.com/in/fas444/"><strong><em>LinkedIn</em></strong></a><strong><em> </em></strong><em>or visit my </em><a href="http://fernandoalcasan.com/"><strong><em>website </em></strong></a><em>:D</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6c9cb100808" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>