Search Unity

can't gate fantasy ai working

Discussion in 'Scripting' started by sirus20x6, Jan 7, 2014.

  1. sirus20x6

    sirus20x6

    Joined:
    Jan 3, 2014
    Posts:
    1
    I'm not sure if this is the right place for this, but I can't seem to get the fantasy ai advanced package from the asset store working with a player controlled character.
    ok what works:
    placing skeletons, guards, or the player prefab. skeletons and guards attack each other, skeletons attack player.

    now the problem is the control setup they have for the player prefab is just total junk. my character loads in and shoots hundreds of feet into the air, holding jump causes him to keep jumping in air, movement speed is always thousands of times too fast even when movement speed is set to 1. pressing forward goes forward, pressing backward goes forward, pressing left goes forward, pressing right goes forward. it doesnt even use a character controller so i cant do an isgrounded check. I tried to rip out their controls but it always either doesnt make the character move/animate or it makes the character fall through the world no matter what kind of collider / collision settings I use and I haven't even gotten to trying to make it work with photon multiplayer yet.


    ok so after a few wasted hours I decided to take my working character prefab and just bring over the ai script, team script, the nav mesh (do i really need that?) anyways after much tweaking i finally got it working except i had a soldier model which doesnt really fit the theme and doesnt have the meele animations and such, so i bring over the spartan king model and animations and now the ai stops working.

    I get this script error
    Code (csharp):
    1. NullReferenceException
    2. UnityEngine.Component.get_gameObject () (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/UnityEngineComponent.cs:171)
    3. UnityEngine.Component.GetComponent (System.String type) (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/UnityEngineComponent.cs:191)
    4. AI.Update () (at Assets/Fantasy AI 2.0/Scripts/AI/AI.cs:566)

    AI.cs line 566 points to:
    Code (csharp):
    1.  
    2.  
    3.         team ais=(team)unitlist[i].GetComponent("team");
    4.                     if(ais){
    5.                         if(ais.transform==transform){}
    6.                     else{
    7.         if(hostile){
    8.             enemys.Add(ais.transform);             
    9.                         }
    10.                            

    which seems to either be complaining about the team id or the tag i can't tell which. the tag is correctly set to character. and the team script is on there with a team id different than the skeletons.

    any help would be much appreciated.
     
    Last edited: Jan 7, 2014