Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Motion Controller

Discussion in 'Assets and Asset Store' started by Tryz, Feb 21, 2014.

  1. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    916
    Make sure that you're using the "Basic" set of motions: BasicIdle, BasicWaklRunPivot, BasicWalkRunStrafe, etc.

    If you're using the shortcuts in Motion Controller's "Basic" view, then it's setting up the older motions (Idle, WalkRunPivot_v2, WalkRunStrafe_v2):

    upload_2020-3-22_14-33-19.png

    I realize that this is counter-intuitive that the "Basic" view doesn't use the motions that are named "Basic X" ... I'm in the process of reworking all of the editor-mode setup tools.

    If you use the Character Wizard to set up a character, you will have BasicIdle, BasicWalkRunPivot, etc set up on the character.

    Then you can either just replace the animations for those animator states with the Generic ones that you're using, or you can replicate those states for your Generic animations -- you just need to use a different L0MotionForm parameter (50, for example). The, on your Actor Core, set the Default Form and Current Form to this value:

    upload_2020-3-22_14-40-17.png

    Jumping and Climbing will be more complicated to get working, as the motion scripts are more tightly coupled to the animations being used. You should be able to just replace the animations in the corresponding animator state machines -- just don't ever recreate the animator states on that character, or you'll lose your changes.
     
  2. JammyGitGames

    JammyGitGames

    Joined:
    Jan 25, 2020
    Posts:
    15
    Many thanks for the response. I'll have a look at the input options tomorrow, sounds like I might need to rethink that a bit. I've fixed up the Basic Interaction issue in my code, so that's fine.
    For the swimming motion, i'm going to be using some different animations, so my main issue is with the camera behaving differently. Is this, as you say, because of the strafing motion being used for swimming instead of a walk/run type of motion? How quick would this be to fix? I'm happy to do it myself if you can give me a few pointers. Many thanks again. Ian.
     
    Subliminum likes this.
  3. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    916
    The approach that I would take is:

    1. Create a new motion using Swim_Strafe as a base. Copy and paste the code in and make sure you change the Phase IDs -- you can't just change the values at the top of the file; you'll need to check for them in all the auto-generated code too.
    2. Compare Swim_Strafe.cs that control movement with WalkRunStrafe_v2.cs and identify the sections of code that are relevant to the strafing movement and rotation.
    3. Using WalkRunPivot_v2 as a reference, copy and modify the movement/rotation code. There will be a bunch of code related to the start/stop transitions and turns that you can ignore.
    That's where I'd start.
     
    Subliminum likes this.
  4. heXzoN

    heXzoN

    Joined:
    Nov 8, 2016
    Posts:
    11
    Hello, recently I encountered issue with Motion/Actor Controller ability to go up the stairs.
    Simply put Actor stuck in the middle of the stairs steps and cannot go up, in some cases where next step is not too high, avatar can climb it but he's popping up and down like "smooth stepping" features is not existing. I checked this feature, but I couldn't managed to get it work so far. I've tried default settings, different values, but they appear are not having any effects. Is there any reason this may be happening? (I am using UMA dynamic avatar setup by the integration video guide)
     
  5. Gabriel_SG

    Gabriel_SG

    Joined:
    Apr 7, 2017
    Posts:
    198
    Under Actor Controller click on Advanced and try messing with the numbers here to fit your environment.

    upload_2020-3-23_19-25-36.png

    Especially Step height and Max Slope.
    upload_2020-3-23_19-26-20.png

    Have fun. :)
     
    Subliminum likes this.
  6. JammyGitGames

    JammyGitGames

    Joined:
    Jan 25, 2020
    Posts:
    15
    Many thanks for that, makes sense. I'll see how I get on and let you know if I get stuck, hopefully should be fine. Thanks again.
     
  7. heXzoN

    heXzoN

    Joined:
    Nov 8, 2016
    Posts:
    11
    Thats the problem -> no matter what values I put there I don't see any changes in the game.
     
  8. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    916
    Double check that there isn't a recipe on the UMA which is creating a default capsule collider. I know there used to be, but I'm not sure if that changed.

    If that's not it, I can take a look if you can zip up a minimal project and send me a link via PM.
     
  9. heXzoN

    heXzoN

    Joined:
    Nov 8, 2016
    Posts:
    11
    Hm, you think UMA may be the case ?
    I am not using default capsule collider from UMA, however UMA has multiple options for colliders and I am using recipe that creates multiple colliders on body parts to simulate ragdoll. I will check if there is any difference after disabling it. I am also using footstep solution from your Vault, however I don't think it is the case.
    I will also check on non UMA models and compare them more closely.
     
  10. heXzoN

    heXzoN

    Joined:
    Nov 8, 2016
    Posts:
    11
    Disabling UMA colliders didn't do any difference.
    I have also tested on non UMA character (default Unity model) in new Project - I think it looks like it works when going up the stairs (there is no head popping up/down), however when going down - instead of smoothly transition it just falls thru multiple steps, like little falling from jump. Not sure if it is how it was intended
     
  11. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    916
    @heXzoN - you can try tweaking the minimum fall height.

    Many games also just use a ramp collider for stairs. You can keep the mesh collider that conforms to the individual steps, but put that on a separate layer for the foot IK (but not grounding).

    I'll try and set it up with a UMA character today and see what kind of behavior I get.
     
  12. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    916
    @heXzoN I set up a new project with Motion Controller and UMA 2.9 and I'm not seeing any different behaviour when walking up or down stairs than when using the Ybot model.

    What height are the steps on the stairs that you're seeing this with? I tried it using the Quickstart Demo Template scene (in ootii/_Demos/__QuickStart/Scenes). I built those stairs with 0.2m high steps (with a depth of about 0.27m each).

    I also built a new set of stairs in Probuilder with 0.3m high steps. Both the UMA and Ybot players work the same way, including walking up the stairs normally, but triggering a fall when going down the steps.

    I think that this is the intended behaviour. I tried increasing the Minimum Fall Height (on the Fall motion) from 0.3m to 0.5m, but this actually results in more erratic behaviour (I had to push it out to 1m or 2m to really see what was happening).

    When the character is "falling" but is at a height between the Minimum Fall Height and the Force Grounding Distance on the Actor Controller, the character is in a null motion on Motion Layer 0. He's not far enough from the ground to allow the Fall motion to activate, but the BasicIdle (and Idle) motion will not activate if the character is not grounded.

    upload_2020-3-24_11-39-16.png


    This hiccup of being briefly in a null motion happens if the Minimum Fall Height is greater than the Force Grounding Distance.

    TLDR; I was able to smoothly climb and descend steps 0.3m in height by increasing the Minimum Fall Height (Fall motion) and the Force Grounding Distance (Actor Controller) to 0.5m. Dropping off a 0.4m high platform also looks smooth. I haven't tested it thoroughly though.

    IMO that's a point in favor of just using ramp colliders for grounding on stairs and using mesh collider that conforms to the steps for IK foot placement. :cool:
     

    Attached Files:

    drcfrx likes this.
  13. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    916
    @Tryz and I are hoping to get a small set of bug fixes pushed out this weekend.

    This currently includes:

    ###Changed
    - [Framework] Added "InitialSize" parameter to static GameObjectPool Initialize() and Allocate() methods, with a default value of 5.
    - [SHMP] BasicShooterReload.GetAmmoQuantity() is now virtual
    - [AC] Updated ActorController.cs so that it stores a copy of the Body Shape definitions in Start(), so that the original body shapes can
    be restored after being removed. Added public CreateBodyShapes() and RestoreBodyShapes() methods.

    ###Fixed
    - [AC] Added null Transform check in property setters to avoid design-time exceptions.
    - [MC] Some options in the BasicInteraction inspector were incorrectly hidden when "Use Raycast" was unchecked.
    - [MP] Fixed an issue where Mount Points were scaling with the parent object when they should not (Courtesy of Thoranar).
    - [SHMP] Impact decals were not being released from the object pool. Fixed (in BasicBullet.cs).


    I just wanted to leave you with a brief preview of a feature coming in the next significant update. This Motion Builder window will generate a customized code template for writing a motion. The options in the left-hand sidebar allow you to add Animation Event constants and toggle the inclusion of virtual method overrides:

    upload_2020-3-25_0-22-48.png

    The help box above the Start Phase ID is a bit verbose, but the list of in-use Phase IDs is not hard-coded; it uses .NET Reflection to query all of the PHASE_START fields in all motions included in the project. I'll probably have it run a check on the entered value and display a message if you enter a duplicate value.

    I have already build a similar window for generating a template for custom Reactor Actions, and I plan on writing ones for Spell Actions and Actor Core Effects. Maybe Bone Motors and Camera Motors as well.

    There is a lot more to come in the next big update; I'll be previewing anything significant in this thread.
     
    drcfrx and Subliminum like this.
  14. heXzoN

    heXzoN

    Joined:
    Nov 8, 2016
    Posts:
    11
    I have tried on different steps, starting from small to large (0.2 - 0.4). Adjusting min falling height and force grounding along with step height and speed actually made some difference.

    Thanks, pretty smart thing to do. I think I will give it a try.

    Also wanted to ask sometimes where there are relatively small holes in the ground (sometimes small hole in the floor, sometimes small distance between large ground objects like rocks), so character should just ignore them, however instead he just floats like not grounded for a few seconds (here is a screenshot example https://prnt.sc/rmex40 ) I have tried to adjust grounding radius property (from 0.2 to 1), however it didn't help. Are there more settings that can affect this?
     
  15. Subliminum

    Subliminum

    Joined:
    Nov 9, 2017
    Posts:
    94
    Seems like the simplest solution would be to have a box collider across the whole paneled floor, If you need more complex collision detection for game mechanics(IE: shooting or ray casting through the gaps), have them on a separate physics detail/dynamics layer which the MC is not using for static/path-finding level geometry. You'd probably get better performance too.
     
    heXzoN and TeagansDad like this.
  16. heXzoN

    heXzoN

    Joined:
    Nov 8, 2016
    Posts:
    11
    Got it. Thanks!
     
    Subliminum likes this.
  17. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    916
    This approach solves many problems that one might experience with character controllers. :cool:
     
    Subliminum and heXzoN like this.
  18. JammyGitGames

    JammyGitGames

    Joined:
    Jan 25, 2020
    Posts:
    15
    Hi, I've got a question on the camera controller, i hope it's ok to post this here. I want to change the 'Anchor offset' when the character starts swimming (using the swimming motion pack). What is the best way to change the anchor offset during game play to make sure there's a smooth transition?
     
  19. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    916
    @JammyGitGames I would add another Camera Motor for this. Use the same type that you're using for regular movement (3rd Person Follow or 3rd Person Fixed) and give it the anchor offset that you want for swimming. To get a smooth transition in and out of this motor, you'll want to create two transition motors that specify how to transition to the Swimming Camera and how to transition out.

    The camera rig set up by the Character Wizard is based on the one from the Archery Motion Pack demo and has a Targeting Camera with Targeting In and Targeting Out transition motors. You can use this example as a guide for setting up your swimming camera.

    There should also be a prefab named Camera Rig (Advanced) somewhere in the _Demos folder. This one has the Targeting motors but also a Locked On motor (for when you lock on to a target in melee) and transitions in and out. I'm away from my computer so I can't check but I don't think this one is activated by an input alias. I don't remember offhand how I set it up. :)

    You may need to write up a simple component or custom Reactor Action that responds to MotionActivated messages and activates the transition into and out of the Swimming camera as appropriate.
     
  20. axel182

    axel182

    Joined:
    Jan 17, 2019
    Posts:
    7
    Hello,

    I'm a big fan of Ootii's assets. I'm glad to read that there are updates coming down the pipeline and I hope we will see even more updates or new assets in the future.

    I'm messaging in the forums because I seem to have stumbled across an issue with the motion controller - or it could be the camera controller, I'm not sure. Anyway, when my character faces directly away from the camera and I quickly move the character such that he should turn 180 degrees to face the camera he doesn't. He over shoots and rotates 270 degrees and then quickly rotates just shy of -90 degrees so that he face just slightly away from the camera. It's very jarring and I don't know why it's doing that. I've already tried removing all Ootii components and reapplying them as a "hard reset" but the issue persists. Any ideas on what it could be?

    Thanks!
     
  21. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    916
    @axel182 Are you using the separate Camera Anchor component? So the Camera Controller 's target is the Camera Anchor, and the Camera Anchor follows the player. I have encountered some glitchy camera behaviour when using it, so that's the first thought I had. Its a simple thing to try and rule out first.
     
  22. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    916
    @JammyGitGames I remember now -- that Locked On camera that I mentioned is activated by the Combatant component, which has fields for setting the camera motor index when the target lock is engaged or disengaged.

    I'll look at adding similar fields for the Swimming Pack motions.
     
  23. axel182

    axel182

    Joined:
    Jan 17, 2019
    Posts:
    7
    No, I'm not using the Camera Anchor component. I also doubled checked to make sure that the Camera Controller was anchored to my character.
     
  24. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    916
    Are you able to zip up and PM a small project for me to look at?
     
  25. axel182

    axel182

    Joined:
    Jan 17, 2019
    Posts:
    7
    yea, I think I can do that. It'll take me a little while cause I have other assets in the project from Synty Studio and Rewired so I'll have to create a new project really quick.
     
    TeagansDad likes this.
  26. JammyGitGames

    JammyGitGames

    Joined:
    Jan 25, 2020
    Posts:
    15
    Hi, many thanks for the responses. I have to admit, I'm still a bit confused. It doesn't look to me like the camera motors control the anchor offset, it seems to be independent of which camera motor you use. I think what you're saying about adding fields to the Swimming Pack motions means that entering swimming mode would switch from one camera motor to another, is that right? Can we make sure there is a smooth transition between the two. Might need more fields in the Swimming Pack to adjust the anchor offset? Are you likely to do it this weekend with the other updates. Sorry, I'm not being pushy, I just want to figure out if I should put any more time into it now and see if I can do it myself, or leave it until you've pushed the updates. Many thanks, Ian.
     
  27. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    916
    If you uncheck "Use Rig Anchor" on then you can specify individual anchor and offset values:

    upload_2020-3-28_10-5-35.png

    You'll need to set the Anchor property on the motor either in the inspector or in the swimming motion before you activate it.

    Yes, it would probably be like on the Combatant component for setting a different camera mode when locked on:

    upload_2020-3-28_10-13-16.png

    In this example, the actual Locked On motor is a 3rd Person Follow at index 5. The cameras at indexes 6 and 7 are transition motors:

    upload_2020-3-28_10-14-24.png

    It wont be this weekend; the update for this weekend is (mostly) just a smallish set of bug fixes. I haven't started adding this yet, and I need some time to experiment with it a bit. Might be able to get added in a couple of weeks, as we would just need to update the Swimming pack and not everything else.
     

    Attached Files:

  28. JammyGitGames

    JammyGitGames

    Joined:
    Jan 25, 2020
    Posts:
    15
    Many thanks for that, all makes sense. I don't think I have the combatant component, is that within one of the combat packs? I only have the motion controller, the camera controller and the swimming motion pack.

    I have set up the camera motors as follows:
    Camera motors.JPG
    I think all I need to do now is run the first of the transitions in the 'EnterWater()' method within the 'SwimmerInfo' class and the second transition in the 'ExitWater()' method. I can't figure out how to run the transitions in this way? Is there a command I can use to run them?
     
  29. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    916
    You're welcome! Yes, Combatant is included in the combat Motion Packs.

    Yes, that's where it should go. You just need to activate the transition motors. Should be a method that looks more or less like: CameraController.ActivateMotor(int rIndex). The Swimming Pack classes won't have a direct reference to CameraController; the reference is probably of type IBaseCameraRig. So you'll need to cast it to the CameraController type first. Something like:

    Code (CSharp):
    1. if (mCameraRig is CameraController cameraRig)
    2. {
    3. var motor = cameraRig.GetMotor(indexOfSwimCamera);
    4. motor.Anchor = cameraRig.Anchor;
    5.  cameraRig.ActivateMotor(indexOfTransition);
    6. }
    You may need to tweak that code a bit. This would be in EnterWater(). You wouldn't need to assign the motor's anchor in ExitWater().
     
  30. JammyGitGames

    JammyGitGames

    Joined:
    Jan 25, 2020
    Posts:
    15
    Wow, thank you so much. I've got it working now, it looks great!
     
    TeagansDad likes this.
  31. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    159
    Hello
    i deactivated this

    motion Controller.enabled = false;
    actor.enabled = false;


    and i moved the character , but when activated (again) the character back to initial position
    how can i fix?
    thanks
     
  32. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    916
    Instead of disabling the MotionController and ActorController components, it might be better to simply set MotionController.InputSource.IsEnabled = false. This will stop it from responding to player input. When the components are disabled, they won't keep track of where the object is being moved to and are probably using their last stored values for the transform and thus putting the character back to the original position.
     
  33. Bucee

    Bucee

    Joined:
    Apr 20, 2016
    Posts:
    13
    Hey @TeagansDad thanks again for your help last time! I've been trying to Equip a bow through a set of triggers, but the normal ActivateMotion("BasicItemEquip1") isn't getting through to the Animator somehow. I've sifted through the documentation and couldn't find anything other than the default keyboard-activation for Equipping, so I was wondering if there's an intended alternative Activation for Equip?

    EDIT: I found on page 114 where Tryz said to use BasicInventory.ToggleWeaponSet(3), that function works for me (although I had to change the 3 to a 0 in my version). Is that the intended function?
     
    Last edited: Apr 6, 2020
  34. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    706
    @TeagansDad is correct: Better to move the Actor Controller using its own movement commands, rather than the Unity transform.move command, if you don't want it to fight you. Here's an example from a script I use:
    Code (CSharp):
    1.  
    2. // This script moves the player to a target position and orientation when he enters a trigger
    3. // Place the script and a kinematic rigid body on a trigger collider
    4. // and provide an empty Transform <newPosition> to serve as the player's target.
    5.  
    6. using UnityEngine;
    7. using System.Collections;
    8. using com.ootii.Actors;
    9.  
    10. public class MoveToPosition : MonoBehaviour {
    11.  
    12.    private GameObject myPlayer; // Player GameObject - must have "Player" tag
    13.    private ActorController lActorController; // Actor Controller
    14.    private bool moveActive = false; // Move action locked
    15.    private bool moveNow = false; // Move action initiator
    16.    public Transform newPosition;  // Empty game object that player will move to
    17.    public bool setDirection = true; // Set true to match player orientation to target as well
    18.    public float startDelay = 0.0f; // Optionally delay repositioning player
    19.  
    20.    void OnTriggerEnter (Collider other) {
    21.        if (other.tag == "Player" && !moveActive) {
    22.            moveActive = true;
    23.            StartCoroutine("Move");
    24.        }
    25.    }
    26.  
    27.    // finds the player and actor controller, and optionally delays the start of the move
    28.    IEnumerator Move () {
    29.         myPlayer = GameObject.FindWithTag("Player"); // Find Player
    30.         lActorController = myPlayer.GetComponent<ActorController>(); // Get ActorController
    31.         yield return new WaitForSeconds(startDelay); // Pause before activating
    32.         moveNow = true;
    33.    }
    34.  
    35.    // move is performed in late update to override any other player movements during the trigger frame
    36.    void LateUpdate () {
    37.        if (moveNow) {
    38.            lActorController.SetPosition (newPosition.transform.position); // Move player to new position
    39.            if (setDirection) {
    40.                lActorController.SetRotation (newPosition.transform.rotation); // Orient player to new position
    41.            }
    42.            moveNow = false;
    43.            moveActive = false;
    44.        }
    45.    }
    46. }
    47.  
     
    Last edited: Apr 5, 2020
  35. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    159
    thanks to everyone.

    i have a new problem

    tryed to use this method

    mMotionController.StartCoroutine(mMotionController.MoveAndRotateTo(target.position, target.rotation, 1f, true, true, true));

    character move an rotate, but there not animation for this.

    works when use

    mMotionController.SetTargetPosition(target.position, 1f);

    but this coroutine look better
     
  36. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    151
    The routine that @FargleBargle shared sets the position and rotation. Did you try it?
     
  37. Invirtuo

    Invirtuo

    Joined:
    Nov 30, 2016
    Posts:
    11
    Hi, I have a problem. I have an NPC setup using "nav mesh input source, actorcontroller and motioncontroller" it is working well to go to a destination point but after that I can`t rotate the NPC to face toward an object (like going treasure near a chest and then rotate to face the treasure chest).

    How can I do that using your asset?
     
  38. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,331
    I'm not sure if Unity's Nav Mesh Agent allows you to rotate without moving. So, you can use this approach...

    When you determine you're at the end of the movement, you can use the MotionController's MoveAndRotateTo coroutine. This allows the character to rotate over time.

    Here's a little sample I put together. How you determine you want to rotate is really up to you.

    Code (CSharp):
    1. using UnityEngine;
    2. using com.ootii.Actors.AnimationControllers;
    3. using com.ootii.Input;
    4.  
    5. public class NavMeshEndRotate : MonoBehaviour
    6. {
    7.     private bool mActivateRotation;
    8.     private NavMeshInputSource mNavMeshIS;
    9.     private MotionController mMotionController;
    10.  
    11.     // Start is called before the first frame update
    12.     void Start()
    13.     {
    14.         mActivateRotation = true;
    15.         mNavMeshIS = gameObject.GetComponent<NavMeshInputSource>();
    16.         mMotionController = gameObject.GetComponent<MotionController>();
    17.     }
    18.  
    19.     // Update is called once per frame
    20.     void Update()
    21.     {
    22.         if (mActivateRotation && mNavMeshIS.HasArrived)
    23.         {
    24.             mActivateRotation = false;
    25.  
    26.             Quaternion lNewRotation = gameObject.transform.rotation * Quaternion.AngleAxis(90, Vector3.up);
    27.             mMotionController.StartCoroutine(mMotionController.MoveAndRotateTo(Vector3.zero, lNewRotation, 0.5f, true, false, true));
    28.         }
    29.     }
    30. }
     
    FargleBargle likes this.
  39. Invirtuo

    Invirtuo

    Joined:
    Nov 30, 2016
    Posts:
    11
    Thank you for your time. It is working to solve my problem.
     
    Tryz likes this.
  40. cruising

    cruising

    Joined:
    Nov 22, 2013
    Posts:
    325
    I tried out your Demo, Do you plan any updates with "sit" feature and footstep sound?
     
  41. Hellwaiker

    Hellwaiker

    Joined:
    Jan 8, 2016
    Posts:
    91
    I'm having some problems with motion Phase Auto Clear. The Motion Phase get's stuck with Start_Phase value and it causes animator to continually re-start the animation node.

    This happens in most basic setup, like Motion Template based motion that plays basic animation when Phase = X, and Form = Y in AnyState transition in animator. I'm calling Activate function on the motion from script. And I'm checking in debug that motion is not activated multiple times.

    For some motions, this was fixed when I Generated the motion Script for the motion, but for others that didn't help.

    What could be causing this?

    I followed debug, and the
           if (State.AnimatorStates[i].AutoClearMotionPhase && State.AnimatorStates[i].TransitionInfo.fullPathHash != 0
    ) on L951 of MotionController.CS is always 0 so AutoClearMotionPhaseReady does not become true and consequently this check fails.
    Code (CSharp):
    1. if (rState.AnimatorStates[i].AutoClearMotionPhase &&
    2.                         rState.AnimatorStates[i].AutoClearMotionPhaseReady &&
    3.                         rState.AnimatorStates[i].MotionPhase != 0)
    4.                     {
    5.                         rState.AnimatorStates[i].MotionPhase = 0;
    6.                         rState.AnimatorStates[i].AutoClearActiveTransitionID = 0;
    7.  
    8.                         //State.AnimatorStates[i].AutoClearMotionPhase = false;
    9.                         //State.AnimatorStates[i].AutoClearMotionPhaseReady = false;
    10.                     }
     
    Last edited: Apr 21, 2020
  42. Hellwaiker

    Hellwaiker

    Joined:
    Jan 8, 2016
    Posts:
    91
    Hmm, I think this could be connected with Instant Transitions, I don't use blending and I have 0 in transition duration from any event. If I set that to smth like 0.1, autoclear works.
    What would you recommend for when I need instant transitions?
     
    Tryz likes this.
  43. ChristianWiele

    ChristianWiele

    Joined:
    Sep 27, 2017
    Posts:
    2
    Hi,

    do you plan to support the new input system? It is so much cleaner than the old on, and the current interface for the input source is bound to the old input system.

    At the moment I have created my own class implementing the interface, but there is one issue I am not sure how to resolve. Some methods of the interface use the key code as parameter. Unfortunately, the old and new key code definitions are incompatible. For instance, the old numbers had values "AlphaX" while the new ones are "DigitX". Also the hash codes have changed, And there doesn't seem to be a mapping table. While I understand when you use the input aliases, I still haven't figured out, when you call the methods with key codes.

    Regards, Christian
     
    axel182 likes this.
  44. Hurtful-Toad

    Hurtful-Toad

    Joined:
    Feb 18, 2016
    Posts:
    18
    With the camera controller First Person View, how do you get a set of arms to rotate pitch along with the camera...? I cant believe Ive worked hours and cant get it.
     
  45. qpham

    qpham

    Joined:
    Mar 20, 2013
    Posts:
    5
    Hi there,

    I just got the Motion Controller but I can't get it to do the following motion control:

    - When the forward key is pressed, move forward.
    - When the left or right key is pressed, rotate the camera and the character left or right while still moving the character if the forward key is pressed (the project is for mobile where there's no mouse to rotate the view).

    That is, rotate the camera and the character in sync on some kind of touch or key input while still moving forward if the forward key is pressed.

    It would be great if the character rotation can the camera rotation speeds can be set slightly difference so the player can see a turning effect on the character, but fine if both are in sync.

    Is this possible with the Motion controller?

    Thanks for your help.
    QP
     
    Last edited: Apr 26, 2020
  46. Smellydave

    Smellydave

    Joined:
    Sep 20, 2013
    Posts:
    4
    Hiya,

    I have just got hold of MC, Camera and the Spell and Shooter packs which I am loving :)
    I am looking to integrate with the Ork framework using real time battles.(I am also new to Ork).

    My control system is basically move and shoot with mouse/keys and cast spells via a spell bar click

    I saw earlier in this thread that @TeagansDad was working on some integrations and was looking for some pointers -

    What I would like to do is have MC handle all movement/anims/controls but Ork all stats/calcs/health etc and also inventory.

    I am not great in C# but learning fast :)

    If anyone could give me some help to get started - or indeed any existing integration I would be really thankful.

    cheers
    Dave
     
  47. John-Lisenby

    John-Lisenby

    Joined:
    Nov 8, 2013
    Posts:
    118
    Hello,

    I have a question / issue. For some reason, I cannot access MotionController and Camera scripts. I'm using both
    using com.ootii.Actors; and using com.ootii.Cameras;. Before, I was able to access them. I want to enable and variables. Has something changed or is this because of asmdf files?

    Thanks,

    John
     
  48. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,331
    I know we went through this in email, but since it's on the forum too I thought I'd respond.

    Since you're having this with other assets and not on your laptop, this sounds a Visual Studio or Unity issue. Your last message to me was this:

    "Seems like Unity is broken in 2019.3.12f. Other are having issues as well. https://forum.unity.com/threads/assemblies-created-in-wrong-directory.881206/ Just a heads up if other send you questions."
     
  49. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,331
    This all comes down to the Input Source for your mobile input. Check out this post on Input Sources for how to create one for the input setup that you're using.

    What you're describing sound similar to the demo_Terrain demo in the MC. I'm using the keyboard, but pressing forward "W" moves forward and pressing the right key "D" turns and moves to the right.

    My suggestion is that you get the movement the way you want in edit mode. Than use the input source to send the right input to mimic that using mobile.
     
  50. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,331
    I'm not sure I follow... "get a set of arms to rotate pitch"

    You might be talking about skeleton bone rotation; like making the spine bend forward as you look forward. If so, you need to access the transform that is your spine and add a rotation. It's not something that camera would do automatically.
     
unityunity