edited September 2016 in ORK Support
I'm trying to implement a floating ability but I'm unable to get walking animation while floating. Is there a way to do this without setting up my own movement animation handling?

Some flag that isn't read only and can be set from another cript, like || this.isfloating in this statement in CombatantAnimations.cs might work:

if(!this.owner.Component.InAir || (this.owner.Component.HorizontalSpeed == 0 && this.owner.Component.VerticalSpeed == 0))
Not sure what other possibilities there are but I'd rather not have to maintain an animation system just for that :)
Post edited by Juryiel on
  • You'd have to do some custom scripting there, e.g. change the code in CombatantAnimations or in the CombatantComponent (e.g. InAir always returning false, or checking a floating status effect, etc.).
    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 figured.

    I'm still not entirely sure about custom scripting - is there a way to override scripts like CombatantAnimations.cs without recompiling ork? If not I think maybe I'll use some form of workaround like spawning an invisible floor at the combatant's feet or something so he can collide with it. I'd rather not have to recompile ORK every update for something so minor.
  • There's currently no way around recompiling ORK in order to do those kind of changes. You could write a custom script/component to change the private inAir field of the CombatantComponent by using reflection.
    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!
  • edited September 2016
    Yeah I actually tried already using reflection to do just that, and wasn't quite able to figure it out - when I was using SetValue() I think I was doing it wrong but this is what I tried:
    FieldInfo field = typeof(CombatantComponent).GetField("InAir", BindingFlags.Instance | BindingFlags.NonPublic);
    field.SetValue(this.combatant.Component, false);
    And the field.SetValue() line gives me an error:

    NullReferenceException: Object reference not set to an instance of an object

    I don't know enough about C# or reflection to fix it :(
    Post edited by Juryiel on
  • OH 'inAir', not 'InAir'. Well thanks for mentioning that, this method failed before when I tried it because I was trying to change InAir which is instead a function.

    Changing 'inAir' works! And animations are playing when walking in the air. Sweet :D
  • That's because InAir is an attribute (without a set part), inAir is the field you can change :)
    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.