Forum rules - please read before posting.

Hotspot walk to gets interrupted for no reason

Hi,

I have been following the tutorials and everything has been working great so far. Except now that I have faced an issue that the character does not complete its "walk to" movement when clicking on a hotspot, even if I define a walk to marker inside the nav mesh. The navigation works perfectly fine otherwise if I click on some walkable area, but not when I click on a hotspot. So the character only moves for one or two steps and then stops. If I click on the hotspot again, it will move for another step or two, but it will not complete its movement for some reason. Any ideas what might cause this?

PS: I am building a 2D project and have been following the guidelines in "Adventure Creator: 2D primer".

Thanks!

Comments

  • Welcome to the community, @donamin.

    What's your Hotspot interaction's Player action field set to?

    If set to Walk To, then the Player will move only a short distance towards the Marker before running the Interaction (a behaviour inspired by The Walking Dead series, where the rest of the movement is implied and hidden with a camera cut)

    You can check Set minimum distance? to control how close they must be to the Hotspot before this occurs.

    However, setting this instead to Walk To Marker will have them move to the Marker completely and only run the Interaction once they've reached it.

    If this field is already set to the latter and you're getting this behaviour, share some screenshots of the issue (Hotspot, marker on NavMesh placement and Player prefab) and I'll try to spot what's wrong.

  • Hi,

    Thanks for the reply.
    Aha ok. Yes walk to marker fixes the issue, but not completely. Because it seems that it doesn't always follow the facing of the walk to marker. Any way to enforce that?

    Also, is there any way to disable this "walking dead behavior"? It is annoying to go over all the hotspots and set the walk to marker.

  • Because it seems that it doesn't always follow the facing of the walk to marker. Any way to enforce that?

    Check Face after moving? just beneath - that should cause the Player to face the Marker's direction once they reach it.

    Also, is there any way to disable this "walking dead behavior"? It is annoying to go over all the hotspots and set the walk to marker.

    If you have many Hotspots, you could use a custom script to switch all of a scene's Hotspots to use "Walk To Marker" instead of "Walk To":

    using UnityEngine;
    using AC;
    
    public class ConvertWalkToSetting : MonoBehaviour
    {
    
        [ContextMenu ("Convert WalkTos")]
        void DoConversion ()
        {
            var hotspots = UnityVersionHandler.FindObjectsOfType<Hotspot> ();
            foreach (var hotspot in hotspots)
            {
                foreach (var button in hotspot.useButtons)
                {
                    if (button.playerAction == PlayerAction.WalkTo)
                    {
                        button.playerAction = PlayerAction.WalkToMarker;
                        #if UNITY_EDITOR
                        UnityEditor.EditorUtility.SetDirty (hotspot);
                        #endif
                    }
                }
            }
        }
    
    }
    

    To use, copy/paste into a C# script named ConvertWalkToSetting.cs, place in the scene, and use the context menu (cog icon to the top-right) of its Inspector to run the "Convert WalkTos" command. It'll then go through each of the Hotspots in the scene and switch any Use interactions that use "Walk To" to "Walk To Marker".

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.