Topic: PM Action Get Marker Instance from Game Object

Hi Alex.

Onlinemaps is great! A am really enjoying use it and everything works so well.

I working in an App where I need add/remove/move the markers.
I am using Playmaker and didn`t find a way to get the marker from the 3DGame Object.

I found the post below that seems to do the job, but my code skills very limited.

https://forum.infinity-code.com/viewtopic.php?id=658

Could you please help me find a way to select the marker from 3DGameObjec or make a PM action like the link above?

Thanks

Re: PM Action Get Marker Instance from Game Object

Hello.

Something like this?

Post's attachments

Attachment icon Get3DMarkerFromInstance.unitypackage 856 b, 87 downloads since 2020-06-20 

Kind Regards,
Infinity Code Team.

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

Re: PM Action Get Marker Instance from Game Object

Wow Alex, this was very fast!!

Unfortunately, I can`t make work in my project.
I am feeding a GameObject variable in the "instance" and an Object variable in the "StoreMarker".
The object variable was created selecting OnlineMapsMarker3DInstance as the type of the object.
The Playmaker FSM is in the Map.

When I try to use it, the StoreMarker object disappears from the Playmaker tab, like if I did not select the Object before hit play.

I checked the GameObject I am trying to use and is a 3D marker and have the OnlineMaps3DInstance Component on it.

Any advice?

Thanks

Re: PM Action Get Marker Instance from Game Object

Video:
https://www.dropbox.com/s/six7sgyzqoqre … 1.mp4?dl=0

What happens in this video:
In State 1, I create a marker and subscribe to a click event.
In State 2, I get the instance from the marker, log the instance, get the marker from the instance, and log the marker.
Both variables are overwritten, and if they are null, there will be an exception.
Playmaker debug will always show None for the marker (and any other Object).
This is a known Playmaker bug and we wrote about it in the documentation.

Kind Regards,
Infinity Code Team.

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

Re: PM Action Get Marker Instance from Game Object

Thanks for the explanation.
Following the video, I may have two problems.

1) I followed your video and could get the same results if I start with one marker, save the instance, use this instance to get the Game object and use this gameObject to get the instance again. But I can`t get working only from a Gameobject from the scene after several markers created.

2) Also, I need from one Marker automatically calculate the distance to all other active markers in the map. The way I was thinking was to find all active Marker Prefabs by tag, put them inside an array and iterate the array to get the Marker instance one by one and calculate the distances. All without the need of clicking the markers. Is this possible?

Not sure if I think this in the right way to achieve what I want.
Any advice?


https://drive.google.com/file/d/1HzEdWX … sp=sharing

Re: PM Action Get Marker Instance from Game Object

Something like this?
https://www.dropbox.com/s/fwzolsylw9azz … 2.mp4?dl=0

Kind Regards,
Infinity Code Team.

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

Re: PM Action Get Marker Instance from Game Object

Hi Alex, thanks again for the fast support.
Your video gave me some insights on how to achieve what I need.