1 (edited by digitalrock 2017-09-22 00:46:24)

Topic: Get Marker from game object?

I have a 3D marker in the scene (tileset map), with OnPointerClick event handled by a script.  I would like to get the OnlineMapsMarker3D component from this game object.  Is this possible without keeping track of the marker (or index); strictly getting it from the game object and/or it's children?

Thanks.

EDIT:  Here's the error I'm getting:

ArgumentException: GetComponent requires that the requested component 'OnlineMapsMarker3D' derives from MonoBehaviour or Component or is an interface.

Re: Get Marker from game object?

Hello.

OnlineMapsMarker3D marker3D = GetComponent<OnlineMapsMarker3DInstance>().marker as OnlineMapsMarker3D;
Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Get Marker from game object?

Thanks that worked great!