<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Online Maps with GameObjects]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1571&amp;type=atom" />
	<updated>2020-08-21T10:46:01Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=1571</id>
		<entry>
			<title type="html"><![CDATA[Re: Online Maps with GameObjects]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6607#p6607" />
			<content type="html"><![CDATA[<p>It is a bad idea.<br />You will have a great loss of performance.</p><p>Why are you using marker3D.relativePosition?<br />This field contains the relative position on the map (XZ contains values 0-1, Y is always 0), not a position in the scene.</p><p>Also, you are not destroying the marker, and if you calling this code constantly, you will have a huge memory leak.<br />The correct way to destroy the marker is OnlineMapsMarker3DManager.RemoveItem.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2020-08-21T10:46:01Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6607#p6607</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Online Maps with GameObjects]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6603#p6603" />
			<content type="html"><![CDATA[<p>Y position was fine, I ended up just aligning it with the marker<br /></p><div class="codebox"><pre><code>// Marker position. Geographic coordinates.
Vector2 markerPosition = new Vector2((float)actor.actorLongitude, (float)actor.actorLatitude);
// Create 3D marker
marker3D = OnlineMapsMarker3DManager.CreateItem(markerPosition, instance.spawn[actor.actorIndex]);
// create new go at marker position
GameObject newActor = Instantiate(instance.spawn[actor.actorIndex], marker3D.relativePosition, marker3D.rotation);
newActor.transform.eulerAngles = new Vector3(actor.rotationX, actor.rotationY, actor.rotationZ);
// get rid of the marker
Destroy(marker3D.transform.gameObject);</code></pre></div>]]></content>
			<author>
				<name><![CDATA[mcb]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1341</uri>
			</author>
			<updated>2020-08-20T20:44:17Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6603#p6603</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Online Maps with GameObjects]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6590#p6590" />
			<content type="html"><![CDATA[<p>Most likely, your model just has the wrong Y alignment.</p><p>How to fix it:<br />- Create a new empty GameObject.<br />- Place your model inside GameObject.<br />- Align your model so that y = 0 is at the bottom of the model.<br />- Create a prefab from an external GameObject, and use that for GetWorldPosition or markers.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2020-08-18T20:00:56Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6590#p6590</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Online Maps with GameObjects]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6589#p6589" />
			<content type="html"><![CDATA[<p>I see that a 3d marker solves that issue, but I would still like to know how to do it without refactoring.&nbsp; Seems like I&#039;m probably missing something very simple</p>]]></content>
			<author>
				<name><![CDATA[mcb]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1341</uri>
			</author>
			<updated>2020-08-18T17:12:21Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6589#p6589</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Online Maps with GameObjects]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6588#p6588" />
			<content type="html"><![CDATA[<p>Alex, I&#039;m using the OnlineMapsControlBaseDynamicMesh.instance.GetWorldPosition() to place my models as well, but the model comes in beneath the terrain.<br /> What is the recommended approach to push it up to the surface?&nbsp; I&#039;m at zoom level 15 if it matters, thanks!</p>]]></content>
			<author>
				<name><![CDATA[mcb]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1341</uri>
			</author>
			<updated>2020-08-18T16:34:18Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6588#p6588</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Online Maps with GameObjects]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6497#p6497" />
			<content type="html"><![CDATA[<p>Thanks a lot!</p>]]></content>
			<author>
				<name><![CDATA[orkasan]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1349</uri>
			</author>
			<updated>2020-07-22T14:39:40Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6497#p6497</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Online Maps with GameObjects]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6496#p6496" />
			<content type="html"><![CDATA[<p>OnlineMaps.InMapView<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMaps.html#a903338e51322b7e65aaf663637fbe9cd">http://infinity-code.com/doxygen/online … 3637fbe9cd</a></p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2020-07-22T13:35:51Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6496#p6496</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Online Maps with GameObjects]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6495#p6495" />
			<content type="html"><![CDATA[<p>I have another question. How to determine if the GameObject is inside/outside of the pan area?&nbsp; <br /></p><div class="quotebox"><cite>Alex Vertax wrote:</cite><blockquote><p>Hello.</p><p>Subscribe to OnlineMaps.OnChangePosition and OnlineMaps.OnChangeZoom.<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMaps.html#aa5d1ad65ba903de2b1c5ac37bdd7bfa1">http://infinity-code.com/doxygen/online … 37bdd7bfa1</a><br />When changing the position or zoom of the map, update the positions of your GameObjects using OnlineMapsControlBaseDynamicMesh.GetWorldPosition.</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[orkasan]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1349</uri>
			</author>
			<updated>2020-07-22T12:44:46Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6495#p6495</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Online Maps with GameObjects]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6494#p6494" />
			<content type="html"><![CDATA[<p>Thanks a lot, now it is solved. I was using lat-lon order..</p>]]></content>
			<author>
				<name><![CDATA[orkasan]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1349</uri>
			</author>
			<updated>2020-07-22T11:58:26Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6494#p6494</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Online Maps with GameObjects]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6493#p6493" />
			<content type="html"><![CDATA[<p>Your code looks fine.<br />There may be reasons:<br />1. You used coordinates that are far from the map view.<br />2. You used the wrong order of parameters in GetWorldPosition. First longitude, then latitude.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2020-07-22T11:50:45Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6493#p6493</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Online Maps with GameObjects]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6492#p6492" />
			<content type="html"><![CDATA[<p>Hi,</p><p>Thanks for the response. I tried the steps you have described however, GetWorldPosition returns quite huge coordinates. </p><p>Here is the code I test with:</p><div class="codebox"><pre><code>    void Start()
    {
        OnlineMaps.instance.OnChangePosition += UpdatePosition;
        OnlineMaps.instance.OnChangeZoom += UpdatePosition;
        UpdatePosition();
    }
    public void UpdatePosition()
    {
        this.gameObject.transform.position =OnlineMapsControlBaseDynamicMesh.instance.GetWorldPosition(55.674160, 12.573540);
    }</code></pre></div>]]></content>
			<author>
				<name><![CDATA[orkasan]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1349</uri>
			</author>
			<updated>2020-07-22T11:44:22Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6492#p6492</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Online Maps with GameObjects]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6491#p6491" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Subscribe to OnlineMaps.OnChangePosition and OnlineMaps.OnChangeZoom.<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMaps.html#aa5d1ad65ba903de2b1c5ac37bdd7bfa1">http://infinity-code.com/doxygen/online … 37bdd7bfa1</a><br />When changing the position or zoom of the map, update the positions of your GameObjects using OnlineMapsControlBaseDynamicMesh.GetWorldPosition.<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsControlBaseDynamicMesh.html#a72cf71ab8fdc9263d81e986316068362">http://infinity-code.com/doxygen/online … 6316068362</a></p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2020-07-22T10:01:15Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6491#p6491</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Online Maps with GameObjects]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6488#p6488" />
			<content type="html"><![CDATA[<p>Hi,</p><p>I would like to add new moving GameObjects to specific coordinates on map, just like marker&#039;s mechanism but not marker. As I pan, I would like GameObjects move along with map also on zoom keep their coordinates, and if they are outside of the pan area they will be inactive. There might be 10000 GameObjects at the same time on whole map but only the ones within the pan area will be shown. </p><p>What would be the best way to achieve this goal?</p>]]></content>
			<author>
				<name><![CDATA[orkasan]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1349</uri>
			</author>
			<updated>2020-07-22T08:03:30Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6488#p6488</id>
		</entry>
</feed>
