<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Marker get events with Collider on Children]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1388&amp;type=atom" />
	<updated>2019-10-31T17:53:52Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=1388</id>
		<entry>
			<title type="html"><![CDATA[Re: Marker get events with Collider on Children]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5720#p5720" />
			<content type="html"><![CDATA[<p>This way it will look for the collider, if it could not found in the same object, it will then look on parent.<br />It&#039;s even possible to modify to get to the marker root. if necessary.</p>]]></content>
			<author>
				<name><![CDATA[mrfigueiredo]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=958</uri>
			</author>
			<updated>2019-10-31T17:53:52Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5720#p5720</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Marker get events with Collider on Children]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5719#p5719" />
			<content type="html"><![CDATA[<p>I take a look to the class you mentioned. <br />I found out that the OnlineMapsControlBase3D get the function.<br />And i could get just a small chance that work for every situation.</p><p>So if you are interested follow the code modification to get it working;</p><p>if (Physics.Raycast(activeCamera.ScreenPointToRay(screenPosition), out hit, OnlineMapsUtils.maxRaycastDistance))<br />&nbsp; &nbsp; &nbsp; &nbsp; {</p><br /><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsMarkerInstanceBase markerInstance = null;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; markerInstance = markerInstance ?? hit.collider.gameObject.GetComponent&lt;OnlineMapsMarkerInstanceBase&gt;();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; markerInstance = markerInstance ?? hit.collider.gameObject.GetComponentInParent&lt;OnlineMapsMarkerInstanceBase&gt;();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (markerInstance != null)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return markerInstance.marker;<br />&nbsp; &nbsp; &nbsp; &nbsp; }</p>]]></content>
			<author>
				<name><![CDATA[mrfigueiredo]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=958</uri>
			</author>
			<updated>2019-10-31T17:52:36Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5719#p5719</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Marker get events with Collider on Children]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5718#p5718" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Theoretically, it is possible.<br />You need to create your own Control that inherits OnlineMapsTileSetControl class, and rewrite GetInteractiveElement method to get OnlineMapsMarkerInstanceBase from the parent GameObjects.</p><p>Practically - in most cases it’s easier and better do not use marker events.<br />Instead, implement custom events on GameObjects that have colliders.<br />To get a marker from the internal collider, use GetComponentInParent&lt;OnlineMapsMarkerInstanceBase&gt;().marker.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-10-31T17:34:13Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5718#p5718</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Marker get events with Collider on Children]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5716#p5716" />
			<content type="html"><![CDATA[<p>The project i am working on, uses markers with a lot of children, and most are mesh, so is necessary tu use mesh colliders.<br />But they are very variable, like lines and such. <br />Is there a way to make the press events work on children colliders?? Until now, all i get to work is with colliders on the root of the marker.</p>]]></content>
			<author>
				<name><![CDATA[mrfigueiredo]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=958</uri>
			</author>
			<updated>2019-10-31T16:52:09Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5716#p5716</id>
		</entry>
</feed>
