Auto Assigning Targets for Spawnable NPCs

NodeCanvas Forums Support Auto Assigning Targets for Spawnable NPCs

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #11855
    k-feelz
    Participant

    Hey there 🙂

    I’m just wondering what’s the best route regarding auto-assigning a non-local gameObject into the “Target” variable slots. Because for the project that i’m working on, it requires spawning in NPC’s with their behaviours however when they spawn, their targets are null.

    What i’m having trouble with is having two prefabs interact with each other. An example i’d like to have, is to make a hunter chase after a fleeing animal (from the hunter) as they’re both spawned in.

    I believe a good way of achieving this is to use the method “findobjectswithtag” and assign the result but i’m unsure where exactly i can put this method of code, or even if it’s possible to customise a blackboard variable inside a script.

    Any help would be really appreciated, thanks 🙂

    #11857
    k-feelz
    Participant

    problem solved, i completely missed the action within “GameObject” seclections xD

    #11858
    Gavalakis
    Keymaster

    Hey,
    Thanks for letting me know that you’ve resolved the issue 🙂
    For your information, yes, you can also completely modify a blackboard variable from within one of your scripts using a few methods as long as you get a reference to the Blackboard component. Here is an example:

    Cheers!

    Join us on Discord: https://discord.gg/97q2Rjh

    #11878
    k-feelz
    Participant

    thank you heaps it’s awesome how flexible it is 🙂 I’m really loving Node Canvas

    #11880
    Gavalakis
    Keymaster

    Thanks!
    Glad I could help and to know that you like NodeCanvas! 🙂

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.