<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>flip Archives - Oxmond Technology</title>
	<atom:link href="https://oxmond.com/tag/flip/feed/" rel="self" type="application/rss+xml" />
	<link>https://oxmond.com</link>
	<description>IT Development</description>
	<lastBuildDate>Wed, 18 Nov 2020 05:11:56 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.0</generator>
	<item>
		<title>How to move and FLIP a 2D sprite with the arrow keys</title>
		<link>https://oxmond.com/how-to-move-and-flip-a-2d-sprite-with-the-arrow-keys-unity-2018-tutorial-for-beginners/</link>
					<comments>https://oxmond.com/how-to-move-and-flip-a-2d-sprite-with-the-arrow-keys-unity-2018-tutorial-for-beginners/#comments</comments>
		
		<dc:creator><![CDATA[Oxmond Technology]]></dc:creator>
		<pubDate>Tue, 20 Nov 2018 08:34:17 +0000</pubDate>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Unity]]></category>
		<category><![CDATA[2018]]></category>
		<category><![CDATA[arrow keys]]></category>
		<category><![CDATA[beginners]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[character]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[coding pirates]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[flip]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[game making]]></category>
		<category><![CDATA[lesson]]></category>
		<category><![CDATA[move]]></category>
		<category><![CDATA[scripting 2d]]></category>
		<category><![CDATA[sprite]]></category>
		<category><![CDATA[sprites]]></category>
		<category><![CDATA[tutorials]]></category>
		<guid isPermaLink="false">https://oxmond.com/?p=271</guid>

					<description><![CDATA[<p>How to move and flip a 2D character with scripting (C#) in Unity 2018, using the left and right arrows keys to move the player. Unity beginner tutorial. ❤️ Subscribe to Oxmond Tutorials:https://bit.ly/SubscribeOxmondTutorials✅ Download the free Sunny Land 2D assets here:https://assetstore.unity.com/packages/2d/characters/sunny-land-103349✅ Other free packages at...</p>
<p>The post <a rel="nofollow" href="https://oxmond.com/how-to-move-and-flip-a-2d-sprite-with-the-arrow-keys-unity-2018-tutorial-for-beginners/">How to move and FLIP a 2D sprite with the arrow keys</a> appeared first on <a rel="nofollow" href="https://oxmond.com">Oxmond Technology</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>How to move and flip a 2D character with scripting (C#) in Unity 2018, using the left and right arrows keys to move the player. Unity beginner tutorial.</p>
<hr />


<p><span style="font-weight: 400;">❤️ <strong>Subscribe to Oxmond Tutorials:</strong></span><span style="font-weight: 400;"><br /></span><a href="https://bit.ly/SubscribeOxmondTutorials"><span style="font-weight: 400;">https://bit.ly/SubscribeOxmondTutorials</span></a><br /><br />✅ <strong>Download the free Sunny Land 2D assets here:</strong><br /><a href="https://assetstore.unity.com/packages/2d/characters/sunny-land-103349?aid=1100l4p9k">https://assetstore.unity.com/packages/2d/characters/sunny-land-103349</a><br /><br /><strong>✅ Other free packages at the Unity Assets Store:</strong><br /><a href="https://assetstore.unity.com/lists/top-free-packages-13201?aid=1100l4p9k">https://assetstore.unity.com/lists/top-free-packages-13201</a></p>
<p>😷👕 Need a face mask / developer T-shirt? Drop by our shop and get a 20% DISCOUNT on your first purchase by using the discount code OXMONDSALE. Click here: <br /><a href="https://shop.oxmond.com/discount/OXMONDSALE">https://shop.oxmond.com/discount/OXMONDSALE</a></p>




<hr />
<p>● Character script (from video):</p>



<pre>/* .-------.                             .--.    .-------.     .--.            .--.     .--.        
   |       |--.--.--------.-----.-----.--|  |    |_     _|--.--|  |_.-----.----|__|---.-|  |-----.
   |   -   |_   _|        |  _  |     |  _  |      |   | |  |  |   _|  _  |   _|  |  _  |  |__ --|
   |_______|__.__|__|__|__|_____|__|__|_____|      |___| |_____|____|_____|__| |__|___._|__|_____|
   © OXMOND / www.oxmond.com */

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour {

	void Update () {

        // Move the Character:
        transform.Translate(Input.GetAxis("Horizontal")* 15f * Time.deltaTime, 0f, 0f);

        // Flip the Character:
        Vector3 characterScale = transform.localScale;
        if (Input.GetAxis("Horizontal") &lt; 0) {
            characterScale.x = -10;
        }
        if (Input.GetAxis("Horizontal") &gt; 0)
        {
            characterScale.x = 10;
        }
        transform.localScale = characterScale;
    }
}
</pre>

<p>● Character script (updated):</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre>using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour {

    Vector3 characterScale;
    float characterScaleX;

    void Start()
    {
        characterScale = transform.localScale;
        characterScaleX = characterScale.x;
    }

    void Update () {

        // Move the Character:
        transform.Translate(Input.GetAxis("Horizontal") * 15f * Time.deltaTime, 0f, 0f);

        // Flip the Character:
        if (Input.GetAxis("Horizontal") &lt; 0) {
            characterScale.x = -characterScaleX;
        }
        if (Input.GetAxis("Horizontal") &gt; 0)
        {
            characterScale.x = characterScaleX;
        }
        transform.localScale = characterScale;

    }
}

</pre>
<!-- /wp:html -->
<p>&nbsp;</p><p>The post <a rel="nofollow" href="https://oxmond.com/how-to-move-and-flip-a-2d-sprite-with-the-arrow-keys-unity-2018-tutorial-for-beginners/">How to move and FLIP a 2D sprite with the arrow keys</a> appeared first on <a rel="nofollow" href="https://oxmond.com">Oxmond Technology</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://oxmond.com/how-to-move-and-flip-a-2d-sprite-with-the-arrow-keys-unity-2018-tutorial-for-beginners/feed/</wfw:commentRss>
			<slash:comments>12</slash:comments>
		
		
			</item>
	</channel>
</rss>
