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.
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 :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I'll look into implementing my move scripts from my old non-ORK project.
Thanks for the info as always.
blindmonkeygames.com/index.html
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.
blindmonkeygames.com/index.html
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..
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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
blindmonkeygames.com/index.html
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).
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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 ;)
blindmonkeygames.com/index.html
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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?
blindmonkeygames.com/index.html
Will be fixed in the next update.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
blindmonkeygames.com/index.html