<?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 — Markers stop moving to player??]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=683</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=683&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Markers stop moving to player??.]]></description>
		<lastBuildDate>Thu, 19 Oct 2017 23:19:06 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Markers stop moving to player??]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2939#p2939</link>
			<description><![CDATA[<p>Hello.</p><p>Your code will not work:<br />1. It contains an infinite loop (you do not update the distance), and you just freeze your application.<br />2. Redraw does not redraw the map right now. It simply marks that the map needs to be redrawn. Drawing will starts later.<br />3. You use Lerp incorrectly, and your enemy will move fast at a big distance (at the beginning) and slowly at a small distance (at the end).</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Thu, 19 Oct 2017 23:19:06 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2939#p2939</guid>
		</item>
		<item>
			<title><![CDATA[Markers stop moving to player??]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2937#p2937</link>
			<description><![CDATA[<p>Good morning, I&#039;m intending to move a marker towards a target and when it is on the way, it stops completely.</p><p>My team and I are developing a game with mechanics similar to pokemon go. I want to move a marker (enemy) to my position but when setting small speeds (to make it as real as possible) it stops.</p><p>the zoom of my map is 17; </p><p>Here are some lines of code:</p><div class="codebox"><pre><code>    void moveEnemy()
    {
       var speed = 0.003f //a little slower than player walking on the street. 

        Vector2 firstPos = myMarker.position;
        float distance= OnlineMapsUtils.DistanceBetweenPoints(myMarkerFirstPos, player.myMarker.position).magnitude;

        while (distance&gt;= 0.05f) //50mts close 
        {
            miMarcador.position = Vector2.Lerp(myMarker.position, player.myMarker.position, speed);
            OnlineMaps.instance.Redraw();
            
        }

    }</code></pre></div><p>ty for help guys</p>]]></description>
			<author><![CDATA[null@example.com (ppizarro)]]></author>
			<pubDate>Thu, 19 Oct 2017 20:21:01 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2937#p2937</guid>
		</item>
	</channel>
</rss>
