Hello there Chris and all the AC group!
So, I've released ENCODYA not even 2 months ago and I'm up for a new game that relies on Adventure Creator!
Something totally different...
This time I'm using a "Click Marker" and I wonder: is it possible to remove it when the Player reaches the destination?
I've a "looped" prefab as click marker (so I'm not relying on the time since spawn). And what I would like is to remove it from the scene when the player reaches the prefab (therefore the destination).
I'm using point-and-click movement system, so there's a path-finding and basically I'd like to write a script to remove the instantiated prefab (click marker) when the Player reaches the end of that path.
I've tried to read the api, but couldn't find a way... (I guess comparing in update player.transform with destionation.transform is not the best... right? I guess there's an event called?)
Any hint is very welcome!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Yes - OnCharacterEndPath is what you want:
For a full list of character-related events, see the Manual's "Character scripting" chapter.
Awesome, thanks!
In addition to removing the click marker when the player reaches his destination, I would also like to remove the marker when player interrupts his movement by clicking on a hotspot instead of the navmesh. How can this be done? It would be great if these two scenarios could be switched on with checkboxes in the settings tab.
Thanks,
Jay
The OnHotspotInteract event will be fired at the moment the player clicks on a Hotspot.
Having the marker auto-remove when clicking a Hotspot is a fair suggestion, though. Would you be looking to have the marker re-appear at the Hotspot?
No, I am currently only wanting the marker for indicating the destination of the click on the navmesh.
Unset the click marker from the Settings Manager and try this script in your scene instead:
Thanks again for the code snippet. I was getting a type error with the last line of your example. The following code works well for me with a looping particle click marker: