PlayMaker Updates & Downloads > Share New Actions

A* pathfinding (stable 0v841)

<< < (83/83)

Christoph:
Hello! Looking for actions as well.

Silicon Power:
Still no action for this asset?

Zenfish:
Here is the only action i need with A*. That allows you to change the target destination (works with the “destination setter” component) It can also be done with the “set property” action. Hope it can help.


--- Code: ---using UnityEngine;
using HutongGames.PlayMaker;
using Pathfinding;

namespace HutongGames.PlayMaker.Actions
{
    [ActionCategory(ActionCategory.ScriptControl)]
    [Tooltip("Change the target of an A* AI agent.")]
    public class AstarDestination : FsmStateAction
    {

        [RequiredField]
        [Tooltip("The GameObject containing the AIDestinationSetter component.")]
        public FsmGameObject MovingObject;
        [RequiredField]
        [Tooltip("The new target to set for the A* AI agent.")]
        public FsmGameObject DestinationObject;

       

        private AIDestinationSetter aiDestinationSetter;

        public override void OnEnter()
        {
            aiDestinationSetter = MovingObject.Value?.GetComponent<AIDestinationSetter>();

            if (aiDestinationSetter != null)
            {
                aiDestinationSetter.target = DestinationObject.Value?.transform;
            }

            Finish();
        }
    }
}
--- End code ---

Navigation

[0] Message Index

[*] Previous page

Go to full version