<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Infinity Code Forum — Teleport and moving the map]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=386</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=386&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Teleport and moving the map.]]></description>
		<lastBuildDate>Thu, 09 Feb 2017 14:43:00 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Teleport and moving the map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1795#p1795</link>
			<description><![CDATA[<p>I just wanted to post and say thanks because this totally helped with an issue I was dealing with. Thank you!</p>]]></description>
			<author><![CDATA[null@example.com (ShaneTheKing)]]></author>
			<pubDate>Thu, 09 Feb 2017 14:43:00 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1795#p1795</guid>
		</item>
		<item>
			<title><![CDATA[Re: Teleport and moving the map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1690#p1690</link>
			<description><![CDATA[<p>It didn&#039;t work at first, but I changed the &#039;+&#039;s in &quot;(p.x + map.tilesetSize.x / -2, map.transform.position.y, p.z + map.tilesetSize.y / 2);&quot; to &#039;-&#039;s and now it works!!! Thank you sooo much!!</p>]]></description>
			<author><![CDATA[null@example.com (alexandra)]]></author>
			<pubDate>Tue, 17 Jan 2017 14:23:14 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1690#p1690</guid>
		</item>
		<item>
			<title><![CDATA[Re: Teleport and moving the map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1689#p1689</link>
			<description><![CDATA[<p>I made corrections in your code.<br />Of course, it is not tested, because I do not have VRTK.<br />But, theoretically, it should work.</p><div class="codebox"><pre><code>protected virtual void SetNewPosition(Vector3 position, Transform target)
{
    transform.position = CheckTerrainCollision(position, target);
    ///// Added code by Alexandra
    Vector3 p = transform.position;
    double lng, lat;
    OnlineMaps map = OnlineMaps.instance;
    OnlineMapsTileSetControl.instance.GetCoordsByWorldPosition(out lng, out lat, p);
    map.SetPosition(lng, lat);
    map.transform.position = new Vector3(p.x + map.tilesetSize.x / -2, map.transform.position.y, p.z + map.tilesetSize.y / 2);
    ///// End code added
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 17 Jan 2017 13:55:28 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1689#p1689</guid>
		</item>
		<item>
			<title><![CDATA[Re: Teleport and moving the map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1688#p1688</link>
			<description><![CDATA[<p>It seemed I had chosen a file, but not clicked &quot;Add file&quot; orz</p>]]></description>
			<author><![CDATA[null@example.com (alexandra)]]></author>
			<pubDate>Tue, 17 Jan 2017 13:43:14 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1688#p1688</guid>
		</item>
		<item>
			<title><![CDATA[Re: Teleport and moving the map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1687#p1687</link>
			<description><![CDATA[<p>Hello.</p><p>Your post does not contain a script.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 17 Jan 2017 12:38:22 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1687#p1687</guid>
		</item>
		<item>
			<title><![CDATA[Re: Teleport and moving the map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1685#p1685</link>
			<description><![CDATA[<p>Hi! I&#039;ve tried doing what you said but I guess there&#039;s still something I&#039;m not quite getting as the player ends up outside of the map boundaries.<br />Attached is the VRTK library Teleport script. You can find the code I added by searching for &quot;Added code by Alexandra&quot;. Thank you so much again for your help <img src="https://forum.infinity-code.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (alexandra)]]></author>
			<pubDate>Tue, 17 Jan 2017 12:15:43 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1685#p1685</guid>
		</item>
		<item>
			<title><![CDATA[Re: Teleport and moving the map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1683#p1683</link>
			<description><![CDATA[<p>Hello.</p><p>You need to change the location of map (map.SetPosition) instead of the position of the map GameObject.<br />Send me your teleport script. I will try to modify it for you.</p><p>Or you can do to map GameObject follow to player GameObject.<br />To do this:<br />1. Teleport.<br />2. Get the coordinates in the player position (OnlineMapsTileSetControl.GetCoordsByWorldPosition).<br />3. Set the new map coordinates (map.SetPosition).<br />4. Update map.transform.position, so center of map was under player position.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 16 Jan 2017 23:38:35 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1683#p1683</guid>
		</item>
		<item>
			<title><![CDATA[Re: Teleport and moving the map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1681#p1681</link>
			<description><![CDATA[<p>And the second image</p>]]></description>
			<author><![CDATA[null@example.com (alexandra)]]></author>
			<pubDate>Mon, 16 Jan 2017 09:14:56 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1681#p1681</guid>
		</item>
		<item>
			<title><![CDATA[Teleport and moving the map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1680#p1680</link>
			<description><![CDATA[<p>Hi!<br />We are using a basic teleport script to move across te map (specifically VRTK Basic Teleport), but the problem is that the player literally teleports to that position on the plane and the image on the plane itself does not move. This means that eventually the player ends up at the border of the plane.<br />Attached are two images to show what I mean.</p><p>Is there an easy way to compensate the map so that it takes the current player position and resets itself so that position is now the middle? Or should I try to modify the teleport script to do this instead?</p><p>I have already tried to do this instead of moving the player on teleport:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; double lng, lat;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OnlineMaps map = OnlineMaps.instance;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; map.projection.TileToCoordinates(target.position.x, target.position.z, map.zoom, out lng, out lat);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; map.SetPosition(lng, lat);</p><p>But this gives a strange result, the lng, lat is not as expected.</p>]]></description>
			<author><![CDATA[null@example.com (alexandra)]]></author>
			<pubDate>Mon, 16 Jan 2017 09:13:32 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1680#p1680</guid>
		</item>
	</channel>
</rss>
