<?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 Rusben Guzman on Medium]]></title>
        <description><![CDATA[Stories by Rusben Guzman on Medium]]></description>
        <link>https://medium.com/@rusbenguzman?source=rss-c425e4e7bcd8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZvE0v5jgn_h3_Mm382tfDQ.jpeg</url>
            <title>Stories by Rusben Guzman on Medium</title>
            <link>https://medium.com/@rusbenguzman?source=rss-c425e4e7bcd8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 00:43:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rusbenguzman/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[Hacer que la Cámara Siga a el Jugador en Unity con Cinamachine.]]></title>
            <link>https://rusbenguzman.medium.com/hacer-que-la-c%C3%A1mara-siga-a-el-jugador-en-unity-con-cinamachine-15d041cb8589?source=rss-c425e4e7bcd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/15d041cb8589</guid>
            <category><![CDATA[cinemachine]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[unity3d]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[unity-game-development]]></category>
            <dc:creator><![CDATA[Rusben Guzman]]></dc:creator>
            <pubDate>Thu, 05 May 2022 19:30:06 GMT</pubDate>
            <atom:updated>2022-05-05T19:30:06.089Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Objetivo:</strong> Usar Cinemachine para hacer que la cámara siga al jugador.</p><p>Primero se tiene que instalar el paquete Cinameachine. Para eso hay que ir a Window &gt; Package Manager &gt; en la barra de búsqueda hay que escribir Cinemachie &gt; se selecciona el paquete y la opción “Install”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3W6IgZz718vk4yCxpsT_xw.png" /></figure><p>En el editor de Unity aparecerá una nueva opción llamad “Cinemachine”. Para comenzar hay que ir a Cinemachine y seleccionar la opción “Create Virtual Camera”. Esto creará un nuevo GameObject que será la cámara virtual y agregara un nuevo componente en la cámara principal llamado “Cinemachine Brain”. Este componente está encargado de hacer que la cámara principal adopte los comportamientos que definamos en la cámara virtual.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YyDNmmQyccvx04pekgXZ4A.png" /></figure><p>Ahora hay que seleccionar la cámara virtual y agregar a el jugador en las propiedades “Follow” y “Look at”. Con esto hecho la cámara seguirá y apuntará hacia el personaje cuando estemos en playmode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8VRjUIwbm7hhLKsgdKjTcQ.png" /></figure><p>Cinemachine ofrece muchísimas opciones para mejorar el comportamiento de la cámara tanto para el juego como para hacer cutscenes. Como en este ejemplo solo estamos enfocados en seguir al jugador no vamos a adentrarnos en las otras opciones pero algo que se podría hacer para mejorar este movimiento es modificar las “Aim properties”. Para esto en la ventana “game” podemos observar diferentes áreas, una roja que representa lo que no se verá en la cámara, una azul que define que la cámara se tiene que mover cuando el jugador entra en esa zona y una vacía que no ejecuta ninguna acción.</p><p>Para este ejemplo solo moví un poco el área azul para hacer que la cámara espere más antes de empezar a moverse con respecto a el jugador.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*577GEVH9WXM5Pn4CattsQg.gif" /></figure><p>Y eso sería todo!!! Ya tenemos un uso básico de Cinemachine para seguir al jugador con la cámara.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*GBwJ3d_9FKHkSreZ1DCgzw.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15d041cb8589" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Make Camera Follow Player with Cinemachine in Unity]]></title>
            <link>https://rusbenguzman.medium.com/make-camera-follow-player-with-cinemachine-in-unity-5ada531bbe84?source=rss-c425e4e7bcd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ada531bbe84</guid>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[cinemachine]]></category>
            <category><![CDATA[unity3d]]></category>
            <category><![CDATA[game-development]]></category>
            <dc:creator><![CDATA[Rusben Guzman]]></dc:creator>
            <pubDate>Wed, 04 May 2022 18:26:11 GMT</pubDate>
            <atom:updated>2022-05-04T18:26:11.430Z</atom:updated>
            <content:encoded><![CDATA[<h4>Adding a camera follow feature.</h4><p><strong>Objective: </strong>use cinemachine to make the main camera follow the player.</p><p>First of all we have to install a cinemachine. Go to Window &gt; Package Manager &gt; In the search bar type cinemachine and install the package.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3W6IgZz718vk4yCxpsT_xw.png" /></figure><p>Now in the unity editor we have a new tab called cinemachine. We have to go there and select the option “Create Virtual Camera”. This action is going to create a new gameobject for the virtual camera and it’s going to add a new component in the main camera called cinemachine brain. This component is in charge to control all the cinemachine behavior.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YyDNmmQyccvx04pekgXZ4A.png" /></figure><p>In this example we only want to make the camera follow the player. You have to select virtual camera and add the player game object to the follow and look at properties in the inspector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8VRjUIwbm7hhLKsgdKjTcQ.png" /></figure><p>Cinemachine offers a lot of utilities for make awesome use of the camera for the game and cutscenes but in this tutorial we only are focused on making the camera follow the player. Another thing that you can do to improve the camera movement is modify the aim properties. In the game window you can see a red area, a blue area and an empty area. Each area identify a aim property from the virtual camera, in this case I only move the blue area called soft area and it indicated when the player enters in this area the camera has to start moving.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*577GEVH9WXM5Pn4CattsQg.gif" /></figure><p>And that’s it!!! We have a functional cinemachina camera follow feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*GBwJ3d_9FKHkSreZ1DCgzw.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ada531bbe84" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding an Idle Jump Animation in Unity]]></title>
            <link>https://rusbenguzman.medium.com/adding-an-idle-jump-animation-in-unity-1c06ebf17fe3?source=rss-c425e4e7bcd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c06ebf17fe3</guid>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[unity3d]]></category>
            <category><![CDATA[game-development]]></category>
            <dc:creator><![CDATA[Rusben Guzman]]></dc:creator>
            <pubDate>Fri, 29 Apr 2022 20:27:55 GMT</pubDate>
            <atom:updated>2022-04-29T20:27:55.298Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Objective: </strong>Add an animation when the player jumps in idle state</p><p>For this example I downloaded the idle jump animation from mixamo.com and imported it into my unity project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eFhAkrDyJMm1nuDRjghDuw.png" /></figure><p>Then we have to add the animation to the player animator controller and create transitions, one from the idle state to the jump animation and another from idle jump to idle. Also we need a bool parameter to trigger the animation in the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dGG-MkPICQbPLH2eOYgCLw.png" /></figure><p>In the calculated movement function we have to check for the space key to trigger the animation. There is another function calle set grounded values, this function is just to make the transition from jump to idle again and it is called when the player does not presses the space key in the calculate movement function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*14lrqTQhfVxLLgEWtyTmaA.png" /></figure><p>And that’s it!!! We a have a new idle jump animation for the player.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*B3Rg-UPxON12lLFxB0lSRQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*1_ygi5wQY6U6fX3GQ211ug.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c06ebf17fe3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Roll Player Action in Unity]]></title>
            <link>https://rusbenguzman.medium.com/creating-a-roll-player-action-in-unity-822ae094f8e6?source=rss-c425e4e7bcd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/822ae094f8e6</guid>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[unity3d]]></category>
            <dc:creator><![CDATA[Rusben Guzman]]></dc:creator>
            <pubDate>Thu, 28 Apr 2022 19:16:02 GMT</pubDate>
            <atom:updated>2022-04-28T19:16:02.644Z</atom:updated>
            <content:encoded><![CDATA[<h4>Make the player able to roll</h4><p><strong>Objective: </strong>create a functionality to make the player roll when the user presses the left-shift key.</p><p>First we need the animation, for this project I downloaded all the animations from mixamo.com. Just go to the search bar and find the animation you are looking for. In this case I searched for “Roll”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ak2EBS6AXg0SCBtRLKV7Uw.png" /></figure><p>Now in the animation controller I added the new animation and created transitions from idle and run state. I created a trigger parameter called “Roll” to trigger the animation from the script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*P-ZYfrQUVCFZKx__21v-lQ.png" /></figure><p>In the player controller script I declared a transform variable that is used to store the final position when the roll animation finished (this variable is assigned in the inspector). Within the calculate movement function I check for the left-shift key to trigger the animation and also create 2 functions. Roll() triggers the roll animation and disables the player controller and RollCompleted() sets the new position and enables the player controller component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AKNb2ySGnjh2OjkOySqSbw.png" /></figure><p>Next for the roll animation I created a new behavior script. In the script I use the OnStateExit() to call the RollCompleted() function when the animation finishes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*wTQKqiWG-phLBrxfHmp-hw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C0QnfZmCmfhqFbNzSoA7RQ.png" /></figure><p>And that’s it!!! We have a roll animation for the player.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*s-Q3D8Su43oiVCHTEVocHw.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=822ae094f8e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Ladder System in Unity — Part 2: Leaving the Ladder.]]></title>
            <link>https://rusbenguzman.medium.com/creating-a-ladder-system-in-unity-part-2-leaving-the-ladder-9b482e07b4bb?source=rss-c425e4e7bcd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b482e07b4bb</guid>
            <category><![CDATA[unity3d]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[game-development]]></category>
            <dc:creator><![CDATA[Rusben Guzman]]></dc:creator>
            <pubDate>Tue, 26 Apr 2022 21:17:38 GMT</pubDate>
            <atom:updated>2022-04-26T21:17:38.781Z</atom:updated>
            <content:encoded><![CDATA[<h3>Creating a Ladder System in Unity — Part 2: Leaving the Ladder.</h3><h4>Now the player has to leave the ladder.</h4><p><strong>Objective:</strong> update the ladder system script to make the player able to leave the ladder.</p><p>For this example I added new animations, one for the climb ladder action and another for fall from the ladder.i In the animation controller these animations are triggered from any state and then go back to the idle state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*p6GffF5uUAt_G5mHNnhN0Q.png" /></figure><p>In the player script 2 other functions to set the values of the animators and flags when the player leaves the ladder and when is grounded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_w1ZQYBL91LsXLPzlERPEg.png" /></figure><p>In the ladder system script I created a conditional within the OnTriggerEnter function, if the player presses the up/down keys he is going to climb the ladder and if he presses the left/right key he falls from the ladder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CygbeJfAXPo6BBKAHplg3Q.png" /></figure><p>And that’s it!!! Now the player can leave the ladder at any moment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*mpO7ufkFdstxFx7k3r6aiA.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b482e07b4bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Ladder System in Unity — Part 1: Climb Ladder]]></title>
            <link>https://rusbenguzman.medium.com/creating-a-ladder-system-in-unity-part-1-climb-ladder-54e7ae84c193?source=rss-c425e4e7bcd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/54e7ae84c193</guid>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[unity3d]]></category>
            <category><![CDATA[unity]]></category>
            <dc:creator><![CDATA[Rusben Guzman]]></dc:creator>
            <pubDate>Thu, 21 Apr 2022 21:06:24 GMT</pubDate>
            <atom:updated>2022-04-21T21:06:24.893Z</atom:updated>
            <content:encoded><![CDATA[<h3>Creating a Ladder System in Unity — Part 1: Climb Ladder</h3><h4>Make character reach other platforms with ladders</h4><p><strong>Objective: </strong>Create a script to make the player able to climb a ladder.</p><p>The first step is to have some game object to use as a ladder in the scene, in this case I downloaded a ladder platform from filebase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*h6Kukf5TbdRkJt5BP0fgxQ.png" /></figure><p>Then I created a new cube as a child of the platform, set the collider as a trigger, and created a new script to detect the collision with the player and start with the climb ladder mechanic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oRyq8vn4AnNI6X7eURuoWw.png" /></figure><p>In the player script I created 2 methods, climb ladder is to set the player values when it reaches the ladder and calculate ladder movement allow us to move the player across the ladder when the user presses the movement keys.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Cv7O2L4Hg1aAFK6MZUYRw.png" /></figure><p>Next in the ladder system script, by using the function OnTriggerEnter we check for the player tag and call the Climb Ladder function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HdTO6E4AsG_7BxP0R362sw.png" /></figure><p>And we have the first step ready, now the player can start climbing the ladder, but still needs to leave it. In the next article I’l show you how to do that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*rQb3XjM3YoS9BB7qnEx-SA.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54e7ae84c193" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create Moving Platform in Unity]]></title>
            <link>https://rusbenguzman.medium.com/create-moving-platform-in-unity-93d80d714df9?source=rss-c425e4e7bcd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/93d80d714df9</guid>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[unity3d]]></category>
            <dc:creator><![CDATA[Rusben Guzman]]></dc:creator>
            <pubDate>Wed, 20 Apr 2022 20:15:37 GMT</pubDate>
            <atom:updated>2022-04-20T20:15:37.875Z</atom:updated>
            <content:encoded><![CDATA[<h3>Create Moving Platform in Unity.</h3><p>The first step is to create a platform object in the scene (in this case i am using a 3d model with a collider) and create two empty objects with the position a and b to move the platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_HM-0h1AfLJC7A_qTc31QQ.png" /></figure><p>We have to create a new script called moving platform and add it to the moving platform object. In the script we have some vector 3 variables to store the initial a position, b position and currentTarget. And some variables related with the movement like the speed.</p><p>In the start function we have to initialize the point A and B with the position of the point A and B game Objects (we don’t use the position of these objects for the calculation because they are moving with the platform).</p><p>In the Update method we check if the platform reached one of the points to move to the other and use the function MoveToward to move the platform the current target by assigning the result of the function to the platform position.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nj84MsZOyH-Duv5lFeIo0w.png" /></figure><p>And that’s it we have a functional moving platform in Unity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*cpbVLCPr26dIu6Z8ZwdN9A.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93d80d714df9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Animate Collectable in Unity]]></title>
            <link>https://rusbenguzman.medium.com/animate-collectable-in-unity-d00a0de1c781?source=rss-c425e4e7bcd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/d00a0de1c781</guid>
            <category><![CDATA[unity3d]]></category>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[csharp]]></category>
            <dc:creator><![CDATA[Rusben Guzman]]></dc:creator>
            <pubDate>Tue, 19 Apr 2022 18:52:22 GMT</pubDate>
            <atom:updated>2022-04-19T18:52:22.047Z</atom:updated>
            <content:encoded><![CDATA[<h3>Animate Collectable in Unity.</h3><h4>Give more live to the collectables on your game!!</h4><p><strong>Objective: </strong>create a spin animation for the collectable prefab.</p><p>First step is to add an animator component to the collectable in the scene.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K_OSwTmpytNJ60OGSFR8oA.png" /></figure><p>We have to create a new animator controller and a new animation, the animator controller has to be assigned in the inspector and the animation has to be added to the animator controller.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*DYiAZutFTtUSdNXE7Cypaw.png" /></figure><p>Then we have to select the object and go to the animation window, press the record button and and change the rotation of the object in the timeline. To finish the animation you have to select the record button again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*ZuKyVFx084wv1RYMQxtysA.gif" /></figure><p>And that’s it we have a simple rotation animation for our collectables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*fXAQs-mM3Wfei_FIjitjsA.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d00a0de1c781" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UnitHow to Create a Collectable in Unity]]></title>
            <link>https://rusbenguzman.medium.com/unithow-to-create-a-collectable-in-unity-fe99115ccfd0?source=rss-c425e4e7bcd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe99115ccfd0</guid>
            <category><![CDATA[unity3d]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[csharp]]></category>
            <dc:creator><![CDATA[Rusben Guzman]]></dc:creator>
            <pubDate>Mon, 18 Apr 2022 16:24:57 GMT</pubDate>
            <atom:updated>2022-04-18T16:24:57.751Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Create a Collectable in Unity</h3><h4>Coins, Gems and More….</h4><p><strong>Objective: </strong>download an asset and create a collectable for your game.</p><p>For this example I downloaded a 3d battery model for my game and added it to the scene.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vRKLKs0-wei9toi60ClwXg.png" /></figure><p>With the model in the scene we have to add a collider component to detect the player, in this case the capsule collider is ideal for this asset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eYIc8r_P4DU2xnJjyOao6Q.png" /></figure><p>Then We have to create a collectable script and attach it to the collectable. In the script we have to use the function on trigger enter to check the player tag and Update the UI counter and destroy the collectable given the illusion that the player collected it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BxkrgvlejZEmHIOPoHS79Q.png" /></figure><p>And that’s it!!! We have a new collectable for our Unity game.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*ekZG0oBUBLm3ls0f97Tv7w.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe99115ccfd0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create an Elevator in Unity]]></title>
            <link>https://rusbenguzman.medium.com/create-an-elevator-in-unity-3120883546ea?source=rss-c425e4e7bcd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/3120883546ea</guid>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[unity3d]]></category>
            <dc:creator><![CDATA[Rusben Guzman]]></dc:creator>
            <pubDate>Sat, 26 Mar 2022 13:36:40 GMT</pubDate>
            <atom:updated>2022-03-26T13:36:40.984Z</atom:updated>
            <content:encoded><![CDATA[<h4>More moving platforms for the level.</h4><p><strong>Objective:</strong> Create a moving platform with elevator behavior to move between levels each 5 seconds.</p><p>We have this 3d model that we are going to use as an elevator.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*m-Y4l-0U2aE7scbEDIYjvg.png" /></figure><p>The first step is to create empty objects as a child of the elevator to represent the origin and the final position of the elevator. Then we have to create a new elevator script and attach it to the elevator game object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9AB8iwnOJmQIm7IDbjx_yA.png" /></figure><p>In the new script we have to declare 2 variables to store the reference to the point a and b and the elevator platform. Also some variables related with the movement like the speed, the flag to know which direction to move and the delay to stop and start moving again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*009CtGKIGcButEEWGuSYLg.png" /></figure><p>In the same script we are going to create a new coroutine to move the platform in an infinite loop. In this coroutine we first check if the platform passes some of the 2 points to move to the other direction. Then we check the current value of the flag and assign an int value to the path variable and finally we call the Translate function to move the platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oZ-zkz9rZ2d2rU4to1haXw.png" /></figure><p>After that we can assign the values in the inspector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Je0ZizgCn85k8ElpNHV6jg.png" /></figure><p>And that’s it!!! We have a functional elevator for our levels. Don’t forget to make it a prefab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*YQV4vf5wJJz6DLKupF9SwA.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3120883546ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>