<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Touch marker not run when the markers are close]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=918&amp;type=atom" />
	<updated>2018-10-24T11:51:25Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=918</id>
		<entry>
			<title type="html"><![CDATA[Re: Touch marker not run when the markers are close]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4093#p4093" />
			<content type="html"><![CDATA[<p>Ok Thanks.<br />Finally, I use the Physics raycast to detect the marker and control the UI interface with the GraphicRaycaster to avoid the double interaction.</p>]]></content>
			<author>
				<name><![CDATA[adri2111]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=751</uri>
			</author>
			<updated>2018-10-24T11:51:25Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4093#p4093</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Touch marker not run when the markers are close]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4089#p4089" />
			<content type="html"><![CDATA[<p>I think that the manual OnClick invoke should be used at the last moment only if other ways do not help.</p><p>I recommend the following testing steps:<br />1. Make sure you don&#039;t have UI elements above the markers.<br />By default, it blocks map events and markers events.<br />The easiest way to make sure that the problem is not in UI is to use Online Maps / Troubleshooting / Not Interact Under GUI - OFF.<br />2. Make sure that RaycastHit (from the previous post) contain the correct GameObject.<br />3. Make sure that GameObject has OnlineMapsMarkerInstanceBase component.<br />4. Make sure that OnlineMapsMarkerInstanceBase.marker.OnClick != null.<br />5. Manually invoke OnClick by wrapping it in try / catch to make sure that it does not cause any exception.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2018-10-24T08:48:41Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4089#p4089</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Touch marker not run when the markers are close]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4087#p4087" />
			<content type="html"><![CDATA[<p>Thanks for your tip Alex!</p><p>I tryed it and I saw that the raycast works fine. But the onclick bind funcion doesn&#039;t run.</p><p>I&#039;m going to change the bind function to a manual raycast.</p><p>What do you think?</p><p>Thanks!</p>]]></content>
			<author>
				<name><![CDATA[adri2111]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=751</uri>
			</author>
			<updated>2018-10-24T08:26:42Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4087#p4087</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Touch marker not run when the markers are close]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4081#p4081" />
			<content type="html"><![CDATA[<p>Online Maps makes Raycast to markers, and checks if there is an OnlineMapsMarkerInstanceBase Component on the first hit.</p><p>Try making Raycast yourself to find out which collider triggered.<br />Something like:<br /></p><div class="codebox"><pre><code>RaycastHit hit;
if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, OnlineMapsUtils.maxRaycastDistance))
{
    Debug.Log(hit.collider.gameObject.name);
}</code></pre></div><p>Perhaps some other collider overlaps the marker in your case.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2018-10-23T13:55:39Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4081#p4081</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Touch marker not run when the markers are close]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4077#p4077" />
			<content type="html"><![CDATA[<p>Yes, of course.</p><p>My App and the marker components has this look:<br /><span class="postimg"><img src="http://forum.infinity-code.com/misc.php?action=pun_attachment&amp;item=435&amp;download=0" alt="PunBB bbcode test" /></span></p><p>My code to bind event to marker is this:<br /></p><div class="codebox"><pre><code>public OnlineMapsMarker3D AddNewEgg(Egg egg,bool storage=true){
    GameObject prefabEgg =new GameObject();
    prefabEgg= GetEggPrefab(egg);
    OnlineMapsMarker3D marker = new OnlineMapsMarker3D();
 
    marker = onlineMapsTileComponent.AddMarker3D(egg.longitude, egg.latitude, prefabEgg);
    marker.scale = prefabEgg.transform.localScale.x;
    marker.transform.gameObject.GetComponent&lt;EggComponent&gt;().SetEgg(egg);
    if(storage==true){
        if(egg.typeEgg== Egg.TYPE_MANUAL_HW)
            GameSessionController.control.session.mapEggsManualList.Add(egg,marker);
        else
            GameSessionController.control.session.mapEggsRandomList.Add(egg,marker);
    }
    if(egg.opened==0)
        marker.OnClick += eggC;

    return marker;
}</code></pre></div><br /><p>And my situation is:<br />The click event runs very well with the all eggs on the Unity Editor.<br />But on Android build, only can click on the single eggs. The eggs that are very close to other can not execute the click event, for example the 3 eggs near to the character.<br />Can you give me some tips?</p><p>Thanks!!</p>]]></content>
			<author>
				<name><![CDATA[adri2111]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=751</uri>
			</author>
			<updated>2018-10-23T11:31:45Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4077#p4077</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Touch marker not run when the markers are close]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4064#p4064" />
			<content type="html"><![CDATA[<p>Hello.</p><p>I have never heard of such a problem.<br />Please send instructions on how to reproduce the problem.<br />I&#039;ll check it out and give you some advice on how to fix it.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2018-10-22T16:46:32Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4064#p4064</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Touch marker not run when the markers are close]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4061#p4061" />
			<content type="html"><![CDATA[<p>Hi everyoune!</p><p>I have a problem with the click event in my Android App.<br />The marker clicks run well when they are far. But, when they are very close, It&#039;s impossible to execute the event.</p><p>it&#039;s only appear on the android App. On unity editor the click event run fine.</p><p>What can I do? Some idea?</p><p>Thanks!!!</p>]]></content>
			<author>
				<name><![CDATA[adri2111]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=751</uri>
			</author>
			<updated>2018-10-22T10:52:49Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4061#p4061</id>
		</entry>
</feed>
