edited February 2018 in ORK Support
I use random battles zone & separate battle arena (i.e. "battle" script) at another place of game scene. (I try to migrate from ORK 1 to ORK2). So, after I setup turn-based battle start event, everything seems ok for now, except one thing... My main character after moving to battle arena falls down infinitely (because battle arena has no bottom, it's just a background (2d battle). Other characters (that's spawn only in battle, not in field) spawn correct, enemies also spawn in correct way.

So, how to disable gravity on main character after moving to battle? I don't use rigidbody, just a button player controller. Do I need to use some hacks like invisible floor or special script to disable gravity or I just miss ORK2 setting somewhere?
I don't have such problem in ORK1.
Post edited by Griever on
  • edited February 2018
    Falling down in Battle Arena stops when I disable character controller in editor. It also stops when I set gravity to zero in battle start event. But I don't sure, is this corrent way or not.
    Post edited by Griever on
  • edited February 2018
    At last! I solved this issue by uncheking "Apply root motion" checkbox on Animator component of my main character prefab. Strange, because it has not affect in ORK1.
    Post edited by Griever on
  • Hey,
    The simpler option would be for you to add a simple plane in the editor and disable the mesh renderer. So you have invisible collision to support characters.
    If you need more complex invisible collision, you can also use ProBuilder which became part of Unity. https://www.assetstore.unity3d.com/en/#!/content/111418

    image
    image

    Alternatively, if you still need to disable gravity you could use Battle Start events to either disable gravity globally using Change Gravity node. Or you could search for Combatant Game Objects and Disable gravity with Send Message.
  • edited February 2018
    I thought about these ways, but they seem pretty hacky for me. Disabling "Apply root motion" on character's Animator looks like more proper way.
    Post edited by Griever on
  • The cleanest way to do this would be to set Rigidbody to Kinetic. You can do this via send message and custom code on characters, or you could write your own Event that takes selected combatants data and set's it's rigidbody to kinetic.
  • Using character controller and root motion isn't working very well, so you'll have to decide which one to use.
    However, ORK's built-in controls need a character controller, so in case this is also for the player combatant, you'll have to use custom controls when you want to use root motion.
    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.