<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — RealTileSetExample & FollowGame with rotation of map]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=2378&amp;type=atom" />
	<updated>2025-11-17T10:07:41Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=2378</id>
		<entry>
			<title type="html"><![CDATA[Re: RealTileSetExample & FollowGame with rotation of map]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=9922#p9922" />
			<content type="html"><![CDATA[<p>topLeft/bottomRight come from the current map view, and are calculated based on the center point and map resolution.</p><p>You cannot increase the clipping of the map.<br />But you can manipulate the map zoom and the distance multiplier.</p><p>You can have multiple “cutouts” in only one way - you have multiple maps, each following a different GameObject.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2025-11-17T10:07:41Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=9922#p9922</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: RealTileSetExample & FollowGame with rotation of map]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=9921#p9921" />
			<content type="html"><![CDATA[<p>Is there a way to change the size of the tile that is shown? I assume the size is calculated by this code: </p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Vector2 distance = OnlineMapsUtils.DistanceBetweenPoints(control.map.topLeftPosition,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; control.map.bottomRightPosition);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Set tileset size<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; control.sizeInScene = distance * 1000;</p><br /><p>But I do not know where the topLeft/bottomRight Positions are coming from. I want to increase the clipping of the map.</p><p>Alternativly: Is there a way to have multiple &quot;cutouts&quot; of the map? So, cutouts following multiple game objects?</p>]]></content>
			<author>
				<name><![CDATA[munich_dev]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=4071</uri>
			</author>
			<updated>2025-11-17T09:49:06Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=9921#p9921</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: RealTileSetExample & FollowGame with rotation of map]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=9861#p9861" />
			<content type="html"><![CDATA[<p>Thank you, Alex. That did the trick.</p>]]></content>
			<author>
				<name><![CDATA[munich_dev]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=4071</uri>
			</author>
			<updated>2025-07-29T06:43:33Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=9861#p9861</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: RealTileSetExample & FollowGame with rotation of map]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=9860#p9860" />
			<content type="html"><![CDATA[<p>Hi.</p><p>To fix the problem, replace FollowGameObject.UpdateMap to:<br /></p><div class="codebox"><pre><code>private void UpdateMap()
{
    // Store last position of GameObject
    lastPosition = target.transform.position;

    // Size of map in scene
    Vector2 size = control.sizeInScene;

    // Calculate offset (in tile position)
    Quaternion rotation = map.transform.rotation;
    Vector3 offset = rotation * (lastPosition - map.transform.position + control.center);
    float offsetScale = map.zoomFactor / OnlineMapsUtils.tileSize;
    offset.x = offset.x * offsetScale / size.x * map.width;
    offset.z = offset.z * offsetScale / size.y * map.height;

    // Calculate current tile position of the center of the map
    tx -= offset.x;
    ty += offset.z;

    // Set position of the map center
    if (Mathf.Abs(offset.x) &gt; float.Epsilon || Mathf.Abs(offset.z) &gt; float.Epsilon) map.SetTilePosition(tx, ty);

    // Update map GameObject position
    map.transform.position = lastPosition - rotation * control.center;
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2025-07-28T19:15:18Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=9860#p9860</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[RealTileSetExample & FollowGame with rotation of map]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=9859#p9859" />
			<content type="html"><![CDATA[<p>Hi,<br />I use the scripts &quot;FollowGameObject&quot; and &quot;RealTilesetSizeExample&quot;. They work well together. <br />However, by default the map&#039;s north points to -z. For my use case I want to point the map&#039;s north to +z axis. So I added a 180 deg rotation around y. If I do this, the map won&#039;t follow the game objects properly any more but with an offset. I assume this is due the rotation pivot point of the map. </p><p>Is there another way of telling the map which axis should be used as north? Or is there a way to make the FollowGameObject work, even if the map is rotated? </p><p>Thank you</p>]]></content>
			<author>
				<name><![CDATA[munich_dev]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=4071</uri>
			</author>
			<updated>2025-07-28T15:36:45Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=9859#p9859</id>
		</entry>
</feed>
