Search Unity

Problem with allies not following my currently controlled party leader...

Discussion in 'Scripting' started by BindingForceDev, Jan 4, 2015.

  1. BindingForceDev

    BindingForceDev

    Joined:
    Aug 13, 2014
    Posts:
    40
    I have my latest commit on gitHub if someone wouldn't mind checking out where this problem could be. Through Debug.Logs I have determined that the appropriate target (nearest ally) is being selected by my AI controlled ally, tho for some reason my moveToTarget function (in MoveEntity) won't actually track my ally to the currently controlled party leader. However, the same function tracks my character to targeted enemies just fine... It is passed a transform to track towards. The game is at a very early stage and all sprites and animations are ripped from other games as placeholders, but I'd love to hear anyone's suggestions regarding this issue. :) I'd post just the code involved but a few different scripts are interacting to achieve target tracking when the AI script decides to do so. I have a feeling my issue is either in either my MoveEntity or FindPaths scripts.

    As for controls, tab switches party member control; control, left shift, and left alt trigger attacks (tho just for Ryn now); and space jumps. Arrow keys move the player and Z locks on the nearest target. Some of these controls will work with an attached gamepad as well (that's gonna be fleshed out more in the future).

    https://github.com/funkenation/M7Demo

    Thanks in advance!
     
  2. BindingForceDev

    BindingForceDev

    Joined:
    Aug 13, 2014
    Posts:
    40
    Nevermind! Sorry to waste any time. I had zeroed my newVelocity vector at the start of my dodge function. Removing this line solved the issue!