<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Drag 3D Marker]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1300&amp;type=atom" />
	<updated>2019-07-19T11:26:00Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=1300</id>
		<entry>
			<title type="html"><![CDATA[Re: Drag 3D Marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5339#p5339" />
			<content type="html"><![CDATA[<p>If you want the marker to be optional draggable, you need to implement it yourself.<br /></p><div class="codebox"><pre><code>marker.OnPress += OnMarkerPress;

private void OnMarkerPress(OnlineMapsMarkerBase marker)
{
    if (condition) OnlineMapsControlBase.instance.dragMarker = this;
}</code></pre></div><p>P.S. Using this way, you do not need to use SetDraggable.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-07-19T11:26:00Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5339#p5339</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Drag 3D Marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5337#p5337" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Alex Vertax wrote:</cite><blockquote><p>Actually the problem is in your prefab.<br />1. UI element cannot be 3D marker.<br />2. SpriteRenderer does not need to be UI element.<br />3. When using SpriteRenderer, you need to manually add and configure BoxCollider.</p><p>I made a video of how to create a SpriteRenderer marker:<br /><a href="https://www.dropbox.com/s/m67ltm1868pjlk1/Online%20Maps%20-%20SpriteRenderer%20Marker.mp4?dl=0">https://www.dropbox.com/s/m67ltm1868pjl … r.mp4?dl=0</a></p></blockquote></div><p>Thanks for your video.<br />Managed to get it working. One last question, once we set the marker to be draggable, how do I turn it off?</p>]]></content>
			<author>
				<name><![CDATA[spinball]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=980</uri>
			</author>
			<updated>2019-07-19T00:23:22Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5337#p5337</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Drag 3D Marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5333#p5333" />
			<content type="html"><![CDATA[<p>Actually the problem is in your prefab.<br />1. UI element cannot be 3D marker.<br />2. SpriteRenderer does not need to be UI element.<br />3. When using SpriteRenderer, you need to manually add and configure BoxCollider.</p><p>I made a video of how to create a SpriteRenderer marker:<br /><a href="https://www.dropbox.com/s/m67ltm1868pjlk1/Online%20Maps%20-%20SpriteRenderer%20Marker.mp4?dl=0">https://www.dropbox.com/s/m67ltm1868pjl … r.mp4?dl=0</a></p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-07-18T12:18:59Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5333#p5333</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Drag 3D Marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5329#p5329" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Alex Vertax wrote:</cite><blockquote><p>I have not seen your code, and it is difficult for me to say what is wrong.</p><p>I created a simple test script and it works correctly.<br /></p><div class="codebox"><pre><code>using UnityEngine;

public class TestDrag3DMarker : MonoBehaviour
{
    private void Start()
    {
        double lng, lat;
        OnlineMaps.instance.GetPosition(out lng, out lat);
        OnlineMapsMarker3D marker3D = OnlineMapsMarker3DManager.CreateItem(lng, lat, null);
        marker3D.scale = 50;
        marker3D.SetDraggable();
    }
}</code></pre></div></blockquote></div><p>Not sure if there is something wrong with my prefab... User will select and assign texture to the sprite renderer at runtime...</p>]]></content>
			<author>
				<name><![CDATA[spinball]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=980</uri>
			</author>
			<updated>2019-07-18T02:10:56Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5329#p5329</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Drag 3D Marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5328#p5328" />
			<content type="html"><![CDATA[<p>I have not seen your code, and it is difficult for me to say what is wrong.</p><p>I created a simple test script and it works correctly.<br /></p><div class="codebox"><pre><code>using UnityEngine;

public class TestDrag3DMarker : MonoBehaviour
{
    private void Start()
    {
        double lng, lat;
        OnlineMaps.instance.GetPosition(out lng, out lat);
        OnlineMapsMarker3D marker3D = OnlineMapsMarker3DManager.CreateItem(lng, lat, null);
        marker3D.scale = 50;
        marker3D.SetDraggable();
    }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-07-18T00:20:38Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5328#p5328</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Drag 3D Marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5327#p5327" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Alex Vertax wrote:</cite><blockquote><p>Hello.</p><p>Yes.<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsMarkerBase.html#ad12e52711e22ee13d8c2f2bba1a6a5f6">http://infinity-code.com/doxygen/online … bba1a6a5f6</a></p></blockquote></div><p>Thanks for replying.</p><p>I tried with 2D marker and I&#039;m able to do a long press and drag, however, I&#039;m not able to press and hold and drag the 3D marker.<br />I created a prefab and added it on my map. I set the marker to SetDraggable and subscribed to OnLongPress and OnDrag events. Kind of using the same method as your example. Are there more stuffs that I need to do?</p>]]></content>
			<author>
				<name><![CDATA[spinball]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=980</uri>
			</author>
			<updated>2019-07-18T00:13:41Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5327#p5327</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Drag 3D Marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5318#p5318" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Yes.<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsMarkerBase.html#ad12e52711e22ee13d8c2f2bba1a6a5f6">http://infinity-code.com/doxygen/online … bba1a6a5f6</a></p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-07-17T10:18:31Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5318#p5318</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Drag 3D Marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5317#p5317" />
			<content type="html"><![CDATA[<p>Hi,</p><p>Can I drag a 3D Marker?</p><p>Thanks!</p>]]></content>
			<author>
				<name><![CDATA[spinball]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=980</uri>
			</author>
			<updated>2019-07-17T06:08:26Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5317#p5317</id>
		</entry>
</feed>
