edited September 2016 in ORK Scripting
I'm trying to build a custom movement script for allied characters in a real time battle system. It's mostly based on SimpleMove.cs since that does a pretty decent job.

One of the things I'm trying to accomplish is to have no gravity in some situations. I have a script that computes the gravity vector I want correctly based on the conditions I want, which is great, and I pull the value from that script, and all this works well so far.

But when I then issue a move command:

this.controller.Move ((this.moveDirection * this.moveSpeed + this.grav) * t);

If this.grav is (0, 0, 0), sometimes walking animations will not play, but sometimes they do. I'm not able to follow the animation conditions so I'm not sure exactly when, but basically if I briefly stop the lead character from moving so the following allies stop, and then immediately move him again so they follow, it is likey it will trigger a 'no animation' state, and this won't stop until I stop them from following again.

So this is problematic because for example if I want an ally to float and not fall, he doesn't have walking animations that work correctly. I confirmed that this is also the case in the SimpleMove.cs script so I'm not introducing it - e.g. if I change
this.controller.Move ((this.moveDirection * this.moveSpeed + Physics.gravity) * t);
this.controller.Move ((this.moveDirection * this.moveSpeed + new Vector(0,0,0)) * t);

or similar, this is also the case.

Is there a way to solve this without coding up a custom animation system to handle transitions?
Post edited by Juryiel on
  • I dug more into this and apparently it's mostly a Unity issue in that CharacterController doesn't like 0 vertical velocity. Not sure why but the suggestion everywhere I read is to code around this so vertical velocity is not 0, so I guess I will try to work on that :)
  • You can also try to enable Use Position Change in the combatant's Movement 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!
Sign In or Register to comment.