edited May 2015 in ORK Support
When using the default movement, is there a layer or script we should use to prevent AI from walking through walls, buildings, etc. ?
Looks great if they are a ghost. Not so much when they are not

Also, is this using A* pathfinding? If there is an object in the way of the AI and the destination point, the Ai just walks through or over it never around it.
  • The default movement is pretty dumb and just moves directly to the target. If you're not using a character controller on your combatants, it'll use the transform for movement (i.e. no physics).

    So, yeah, the default movement component is only a dummy script to get you started. You should use NavMesh, custom scripts or 3rd party solutions instead :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • That was a fast answer
    I'll look into implementing my move scripts from my old non-ORK project.
    Thanks for the info as always.
  • I'm trying to figure out how to use a custom move script with ORK's moveAI settings.
    I can select custom
    It requires I have 3 methods (which I have added)
    However, I end up with the following error block (see below)
    Do I need to override some methods for this to work?

    If I implement movement outside of ORK's moveAI, how do I hook into ORK to find out if I am in a battle in order to halt movement?
    I'm thinking of checking the combatant's inBattle (I think that is what is called) flag each update.

    Thanks as always.
    P.S. if you need to see the script, I can send it to you.

    ArgumentException: Type cannot be null.
    UnityEngine.GameObject.GetComponentInChildren (System.Type type) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineGameObject.gen.cs:59)
    UnityEngine.Component.GetComponentInChildren (System.Type t) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineComponent.gen.cs:59)
    ORKFramework.Behaviours.MoveAIComponent.InitMoveComponent ()
    ORKFramework.Behaviours.MoveAIComponent.Stop ()
    ORKFramework.Behaviours.MoveAIComponent.PerformIdle ()
    ORKFramework.Behaviours.MoveAIComponent.Update ()
  • Can you post your custom component settings of the move AI?

    To check if a combatant is in battle, you can use:

    if(combatant.InBattle)

    You'll first need the combatant of the game object - see this how-to for details..
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Here are my settings:
    Component Type: Custom
    Add Component: not checked (component already on prefab)
    Speed Method Name: SetSpeed
    Position Method Name: SetTarget
    Stop Method Name: StopMovement

    Here are the three required methods:
    note: agent is the NavMeshAgent component

    #region ORK Methods
    public void SetSpeed(float speed)
    {
    agent.speed = speed;
    }
    public void SetTarget(Vector3 target)
    {
    agent.destination = target;

    }
    public void StopMovement()
    {
    agent.speed = 0;
    }
    #endregion
  • If your custom script uses a NavMesh agent, why don't you just use the Nav Mesh Agent component type directly?

    The error you've got hints at something not being set/found in your custom setup - since the method names seem correct, I'm guessing you've made a mistake with the component name (which you haven't posted).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Simple, I have yet to get it to work :)
    I attached the custom script and Nava gent works fine (I wasn't using the move AI )

    The component is called AIMove. Is that an OKK class? Thus, the error?

    P.S. it would take to long to try and setup a test project that matches my project environment. I don't hold ORK accountable ;)
  • ORK classes are all within ORKFramework namespaces, i.e. there's little to no influence with other classes. If your class is called AIMove, you'll also need to define that name in the Component Name in the AI mover settings.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I double checked the name and Yes, it set to that name in the AI Mover settings.

    I removed the component from the prefab and checked the Add Component option as a test. The component is not being added.
    I'm guessing ORK can't find the script for some reason.

    FYI: The script is NOT in a name space. Here is the class def


    public class AIMove : MonoBehaviour
    {
    }


    Are you using the standard Unity AddComponent() call for adding the component?

    It shouldn't matter; but, is there a particular folder I should place the component script in order for ORK to find it?

  • Ok, tested using a custom component and you're correct, there's a problem :)
    Will be fixed in the next update.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks for the fix. I guess no one has tried the custom before :)
Sign In or Register to comment.