News Forums RAIN General Discussion and Troubleshooting How add Rain AI in runtime?

Tagged: ,

This topic contains 0 replies, has 1 voice, and was last updated by  alfchee 7 months, 1 week ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #39823

    alfchee
    Participant

    I have a script that will generate random characters but I want all of the generated objects have the same AI but may be with different behaviors. For so I have the AI as a prefab (everything configured) so I do:

    GameObject ai = (GameObject)Instantiate (AIPrefab);
      aiRig = (AIRig) ai.GetComponent<AIRig> ();
      ai.transform.parent = transform;

    But the line that makes the game crash is this one:

    aiRig.AI.Body = newGO; // newGO is the gameobject generated

    And without assign the AI.Body the behaviors are not implemented onto the object… How can I achieve this?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.