<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	Comments on: How To Drag and Drop a 2D Object	</title>
	<atom:link href="https://oxmond.com/how-to-drag-and-drop-a-2d-object/feed/" rel="self" type="application/rss+xml" />
	<link>https://oxmond.com/how-to-drag-and-drop-a-2d-object/</link>
	<description>IT Development</description>
	<lastBuildDate>Wed, 18 Nov 2020 04:21:10 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.0</generator>
	<item>
		<title>
		By: TheUnityNoob		</title>
		<link>https://oxmond.com/how-to-drag-and-drop-a-2d-object/#comment-724</link>

		<dc:creator><![CDATA[TheUnityNoob]]></dc:creator>
		<pubDate>Mon, 16 Nov 2020 00:04:37 +0000</pubDate>
		<guid isPermaLink="false">https://oxmond.com/?p=501#comment-724</guid>

					<description><![CDATA[This does not work in unity 2019 this just moves the sprite to the moon once you click. I might be doing something wrong but this has little room for mistakes.

Absurd.]]></description>
			<content:encoded><![CDATA[<p>This does not work in unity 2019 this just moves the sprite to the moon once you click. I might be doing something wrong but this has little room for mistakes.</p>
<p>Absurd.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: scx		</title>
		<link>https://oxmond.com/how-to-drag-and-drop-a-2d-object/#comment-679</link>

		<dc:creator><![CDATA[scx]]></dc:creator>
		<pubDate>Fri, 09 Oct 2020 11:45:23 +0000</pubDate>
		<guid isPermaLink="false">https://oxmond.com/?p=501#comment-679</guid>

					<description><![CDATA[bool isDragging;
    Vector2 difference;

    public void OnMouseDown()
    {
        isDragging = true;
        difference = Camera.main.ScreenToWorldPoint(Input.mousePosition) - transform.position;
    }

    public void OnMouseUp()
    {
        isDragging = false;
    }

    // Update is called once per frame
    void Update()
    {
        if(isDragging)
        {
           
            Vector2 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition) - transform.position;
            transform.Translate( mousePos- difference);
        }
    }]]></description>
			<content:encoded><![CDATA[<p>bool isDragging;<br />
    Vector2 difference;</p>
<p>    public void OnMouseDown()<br />
    {<br />
        isDragging = true;<br />
        difference = Camera.main.ScreenToWorldPoint(Input.mousePosition) &#8211; transform.position;<br />
    }</p>
<p>    public void OnMouseUp()<br />
    {<br />
        isDragging = false;<br />
    }</p>
<p>    // Update is called once per frame<br />
    void Update()<br />
    {<br />
        if(isDragging)<br />
        {</p>
<p>            Vector2 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition) &#8211; transform.position;<br />
            transform.Translate( mousePos- difference);<br />
        }<br />
    }</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: GeneralistProgrammer		</title>
		<link>https://oxmond.com/how-to-drag-and-drop-a-2d-object/#comment-332</link>

		<dc:creator><![CDATA[GeneralistProgrammer]]></dc:creator>
		<pubDate>Tue, 14 Jan 2020 19:14:27 +0000</pubDate>
		<guid isPermaLink="false">https://oxmond.com/?p=501#comment-332</guid>

					<description><![CDATA[Short and to the point, glad to see you could give us just the bare amount of code needed to create the drag and drop functionality.]]></description>
			<content:encoded><![CDATA[<p>Short and to the point, glad to see you could give us just the bare amount of code needed to create the drag and drop functionality.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
