I'm currently having an issue with the battle AI. Basically, I set the AI to check the distance between user and target. If the enemy is within a distance of the user, it then enables a bool object variable on the user of the AI. However, the AI will not change the variable. It will only change it through the object ID option. This is not desirable, as it needs to be used on multiple AI in the same scene.

The way I set it up works fine in Ork2(currently moving my project to Ork3), so I'm not sure what's wrong.

Thanks
  • Can you post the settings you're using in the node?
    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!
  • Looks correct.
    Is the combatant using object variables?

    If you want to use object variables on combatants, I'd recommend to enable it in the general combatant settings for all combatants - enable Use Object Variables and Local Variables in Combatants > Combatants > General Settings in the Base Settings > Object Variable 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!
  • Yea, those are enabled, but it still doesn't work via battle AI. Tried changing to a local variable in the battle AI, but no good. It works via a machine. Set an auto machine that's using a raycast. Guess I'll do it that way instead.
  • The variable change definitely works (tested it), so I assume either the battle AI itself isn't used or the Change Variables node is not reached due previous nodes/conditions not checking out.
    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!
  • Yeah, I dunno what's up. It worked in Ork2 for me. The battle AI is used because if I put something like 'Use Ability' node, that works when within the distance. I tried removing everything in the Battle AI and just having an object variable change and it didn't work. It's the only Battle AI it has attached at the moment. It will only work if I use Object ID.

    It's fine tho. I think I'll work around it by using an auto-machine to activate the object vars based on distance with a raycast and then use that to enable Battle AI via variable.
  • Hm ... but your combatants are spawned, right?
    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!
  • Yea, player + enemy combatant spawns in.
  • Very strange - can you post the whole battle AI?
    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!
  • Tested it and works fine here.

    This might be due to combatant prefab setup, e.g. if the root of your prefab isn't what's moving, the combatant will always be considered at it's original spawn position. There's the Child as Root setting in the combatant prefab settings for that.
    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!
  • Yea, the root is where all the Ork/makinom components are located. I'll look over it again soon though. It's likely some setting I've overlooked.

    Schematics + a little custom code is working out better for me ATM, so it's not too bad. Kinda setting it up like behaviour trees.

    Thanks for the help
Sign In or Register to comment.