<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — User control stops working with the RealTilesetSizeExample script]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=909&amp;type=atom" />
	<updated>2018-10-10T12:17:42Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=909</id>
		<entry>
			<title type="html"><![CDATA[Re: User control stops working with the RealTilesetSizeExample script]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4023#p4023" />
			<content type="html"><![CDATA[<p>I have solved it by settings Zoom (1-20) under Use Elevation to 1 - 20. It seems like it is generating a new mesh which has the same size as the real size tilemap. When use elevation was turned off, the mesh was smaller than the tileset so I lost user control as the mouse wasn&#039;t hovering over any mesh.</p>]]></content>
			<author>
				<name><![CDATA[GingerBeard]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=813</uri>
			</author>
			<updated>2018-10-10T12:17:42Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4023#p4023</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: User control stops working with the RealTilesetSizeExample script]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4018#p4018" />
			<content type="html"><![CDATA[<p>It didn&#039;t work by increasing OnlineMapsUtils.maxRaycastDistance.</p><p>I&#039;ve worked around it by creating a new script calling this function when a button is clicked instead of using the example script.<br /></p><div class="codebox"><pre><code>public void SetRealSize() {
    // Get distance (km) between corners of map
    Vector2 distance = OnlineMapsUtils.DistanceBetweenPoints(OnlineMaps.instance.topLeftPosition,
        OnlineMaps.instance.bottomRightPosition);

    // Set tileset size
    OnlineMaps.instance.tilesetSize = distance * 1000;

    // Redraw map
    OnlineMaps.instance.Redraw();


    SetCenterPosition();
}</code></pre></div><br /><p>I attached a screenshot of the Online Maps component.</p><p>Edit: I still get some problems it seems like. Control is lost whenever zoom gets to 15 or 19 for some reason.</p><p>Just as a test I did this which stops all control at 15 or 19 zoom:<br /></p><div class="codebox"><pre><code>private void Update() {

        if(zoomValue != onlineMaps.zoom) {
            SetRealSize();
        }
        zoomValue = onlineMaps.zoom;
    }

    public void SetRealSize() {
        // Get distance (km) between corners of map
        Vector2 distance = OnlineMapsUtils.DistanceBetweenPoints(OnlineMaps.instance.topLeftPosition,
            OnlineMaps.instance.bottomRightPosition);

        // Set tileset size
        OnlineMaps.instance.tilesetSize = distance * 1000;

        // Redraw map
        OnlineMaps.instance.Redraw();


        SetCenterPosition();
}</code></pre></div><p>Edit 2: For some reason it works better with having Use Elevation set to true. I can go between 11 and 20 without the losing user control.</p><p>Edit 3: Updated to the latest version but I still have the same problem.</p>]]></content>
			<author>
				<name><![CDATA[GingerBeard]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=813</uri>
			</author>
			<updated>2018-10-09T09:30:36Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4018#p4018</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: User control stops working with the RealTilesetSizeExample script]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4009#p4009" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Most likely the problem is that the camera is very far from the map.<br />Try increasing OnlineMapsUtils.maxRaycastDistance.</p><p>If the problem persists, please send a screenshot of Online Maps component.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2018-10-06T14:52:24Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4009#p4009</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[User control stops working with the RealTilesetSizeExample script]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4007#p4007" />
			<content type="html"><![CDATA[<p>Hi!</p><p>I have enabled Allow User Control on the OnlineMapsTileSetControl script and it works like expected, but when I add the RealTilesetSizeExample to the same GameObject all user control stops working. Does anyone else have the same problem and know how to fix this?</p>]]></content>
			<author>
				<name><![CDATA[GingerBeard]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=813</uri>
			</author>
			<updated>2018-10-05T13:49:11Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4007#p4007</id>
		</entry>
</feed>
