Search Unity

Motion Controller

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

  1. tchris

    tchris

    Joined:
    Oct 10, 2012
    Posts:
    133
    I saw that you added the effects in this last update. Can you tell me how it's intended to be used? I see it's in the Attackstyle but how should I set the effect. Would I set it in a Preattack reactor ? And then on the other side, how would the defender know that this effect is active on that attack style?
     
  2. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
    Will be amazing to see some projects create with ootii and what the People make all with ootii maybe someone has already made a Video
     
  3. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Mostly this is foundational code. I just didn't want to get my version of the MC too far away from what you guys have. So, I'll be adding to it and explaining more about it soon.

    For now, just consider that field a simple value (it's just an int) that you can set, read, or ignore as needed.

    You can set it like this:
    Code (CSharp):
    1. Combat.AttackStyle lStyle = new Combat.AttackStyle();
    2. FlagsHelper.AddValue(ref lStyle._Effects, Combat.EnumCombatStyleEffect.KNOCK_BACK);
    3. FlagsHelper.AddValue(ref lStyle._Effects, Combat.EnumCombatStyleEffect.STUN);
    4.  
    5. FlagsHelper.RemoveValue(ref lStyle._Effects, Combat.EnumCombatStyleEffect.STUN);
    You would use a reactor to set the effects similar to what you've been doing.

    When the combat message is passed to the defender, it includes a "Combat Style" parameter. You can access it in a reactor and then use code to determine if the character should be stunned or not.
    Code (CSharp):
    1. if (FlagsHelper.ContainsValue(rCombatMessage.CombatStyle.Effects, Combat.EnumCombatStyleEffect.STUN))
    2. {
    3.     // Do stun
    4. }
    My plan is to add a multi-select drop-down to the attack style list. This way you can set it there. But I've got some things to do before I get there.
     
    tchris likes this.
  4. tectuma

    tectuma

    Joined:
    Nov 26, 2012
    Posts:
    46
    I am no expert but in D&D if I remeber right Gelatinous Cubes require a +4 roll on physical attacks. Maybe your toon is just unlucky... :) Just kidding...
     
    Tryz and tchris like this.
  5. tectuma

    tectuma

    Joined:
    Nov 26, 2012
    Posts:
    46
    IFY - I got some more of the motion controller working with SpatialOS. (only for the input manger now). Here is what I did.

    WARNING: This is very ugly and there is prob a better way to do it. I did it fast to get it in and is more of a prof of concept.

    In Spatial I added these in to the schema in my player movement:

    string raction3 = 6;
    string raction6 = 7;

    Then inside of unity3d I made two scrips one to act as a input for the Motion Controller and the other to get the input from the player.

    In the scrip for the player input I required write to the variables making sure only the player had write permissions to them in the EntityTemplateFactory.cs. In the player input scrip I did:

    Code (CSharp):
    1.  
    2.             if (UnityEngine.Input.GetButtonDown("Jump"))
    3.             {
    4.                 if (raction3Value != "Jump")
    5.                 {
    6.                     raction3Value = "Jump";
    7.                     _PlayerMoveMentWriter.Send(new PlayerMoveMent.Update().SetRaction3("Jump"));
    8.                 }
    9.             }
    10.  
    and...

    Code (CSharp):
    1.  
    2.             if (UnityEngine.Input.GetButton("Jump"))
    3.             {
    4.                 if (raction6Value != "Jump")
    5.                 {
    6.                     raction6Value = "Jump";
    7.                     _PlayerMoveMentWriter.Send(new PlayerMoveMent.Update().SetRaction6("Jump"));
    8.                 }
    9.             }
    10.  
    For each unique name in the input manager in unity3d. Told you it not a pretty, but I could not find a good way to pull the name and did not have time to hunt it down. This part checks if jump is pressed and then looks to see if it is all ready sent jump, if not then send the string to SpatialOS.

    Then all I had to do in the input scrip for Motion Controller was make a event that fired every time the SpatialOS variable changed to set a string. Then:

    Code (CSharp):
    1.  
    2.         public virtual bool IsJustPressed(string rAction)
    3.         {
    4.             if (rAction == raction3Value)
    5.             {
    6.                 return true;
    7.             }
    8.             else
    9.             {
    10.                 return false;
    11.             }
    12.         }
    13.  
    You get the idea...

    So when a player presses jump. It sends that key press to the server. Then it goes out to the server toon, player toon and all the proxy toons what was pressed and the Motion Controller reacts to it.

    Only thing left was add scrips to keep the transform and rotation sync with what the server has just in case things got a little off and there you have it. It also allows me to up date ootii wonderful Motion Controller with out overwriting any of my code and movement is taking place server side. :p
     
    Tryz likes this.
  6. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    That's really awesome! Thanks for sharing too.

    One day when I'm not behind on everything I'll check out SpatialOS. :D
     
  7. MarkusGod

    MarkusGod

    Joined:
    Jan 10, 2017
    Posts:
    168
    Hello, how can I get current playing motion, like "Basic melee attack", from the script?
     
  8. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hi @MarkusGod Thanks for sending your order information :)

    In the documentation (page 28) I talk about different things you can do from code.
    http://www.ootii.com/Unity/MotionController/MC2Guide.pdf

    However, it looks like I never showed the ActiveMotion property and function. :eek:

    To get the current playing motion, you can do this:
    Code (CSharp):
    1. mMotionController = gameObject.GetComponent<MotionController>();
    2. MotionControllerMotion lMotion0 = mMotionController.ActiveMotion;
    3. MotionControllerMotion lMotion1 = mMotionController.GetActiveMotion(1);
    The property allows you to grab the motion from the first layer while the the function allows you to specify the layer since you can have a motion running per layer.
     
    hopeful, TeagansDad and MarkusGod like this.
  9. futurewavecs

    futurewavecs

    Joined:
    Jul 26, 2012
    Posts:
    72
    I've had these products for quite awhile. I've been focusing on my character system which is pretty detailed and now I wanted to try the Third Person controller on a character.

    I am using a basic DAZ character. I just went to Component | Ooti | Motion Controller and set it to MMO. Pretty much following the video and the written docs.



    The problem is I am getting compiler errors. I haven't attempted to resolve these myself yet.



    The text of that error is as follows (you might prefer to the screenshot):

    Assets/ootii/MotionController/Code/Actors/AnimationControllers/MotionController/Motions/BasicCoverStrafe.cs(616,70): error CS1061: Type `CameraController' does not contain a definition for `ActiveMotor' and no extension method `ActiveMotor' of type `CameraController' could be found. Are you missing an assembly reference?

    I did search this forum but didn't find a result. I may have missed something.

    Now I do have the following ooti products installed:



    This should be Third Person Controller, Camera Controller, Swimming, Sword And Shield, Archery, and Spell Casting.

    I also plan on attempting to integrate some more of the Mixamo animations, as well as others I have at some point, but I wanted to get the basic functionality in place first.

    If you can point me in the direction of how I can resolve that issue it would be appreciated.
     
  10. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hey @futurewavecs ,

    Please email your Unity Order ID to tim@ootii.com. This way I can track users and the support. :)


    I'm pretty confident you've got a namespace issue. I confirmed that my CameraController.cs has the ActiveMotor property at line 194, but you're picking up a different class that uses the same name ("CameraController").

    Think of namespaces like last names. If there's a room full of people named Tim and you yell "Tim, come here"... there's no guarantee which Tim you'll get. However, if you yell "Tim Smith, come here" you'll get the right one.

    Search your project for classes named "CameraController". I bet you find at least one besides mine. One of them isn't using namespaces and that's causing the issue. You'll need to remove the bad one or contact that developer and ask them to use namespaces. They should as it's standard coding practice. Otherwise, no one in the entire world can ever use the name "CameraController".
     
    Last edited: Oct 29, 2017
  11. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    429
    I want to add footsteps for my MotionController player so I'm planning to add events in each animation. Looking at the Animator (MC_Humanoid_01) and all the animation clips in the MotionController/Content/Animations/Humanoid/ folders, everything's an uneditable fbx, so I'll have to duplicate each child clip, then make my change (add the events) then re-link in the Animator. To make this process even more complex, some of the animation clips are called the same thing (e.g. unity_walk fbx has a WalkFWD clips, but the fbx unity_WalkFWD also has a WalkFWD clip, as well as a WalkForward clip. It's impossible to know which is being used, and where each is being used in the Animator).

    So, to make things easier, do you have a file that lists the links from each of the Animator states to each of the fbx and child child clip names?

    And finally, would you consider making your clips editable in the package - so that adding custom events is easier for your users?

    Or am I just going about it all the wrong way and is there an easier way to do this?

    Thanks!
     
  12. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Last edited: Oct 29, 2017
    antoripa likes this.
  13. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    @Tryz

    Hey Tim. i have a question regarding reactors:

    I have added the following to the BasicMeleeBlock State machine:

    upload_2017-10-29_15-53-25.png

    With the following parameters:

    upload_2017-10-29_15-53-54.png

    Then i have created the following reactor:
    Code (CSharp):
    1.  
    2. public void dodgeAttack(ReactorAction rAction)
    3. {
    4.     if (rAction == null || rAction.Message == null)
    5.     {
    6.         return;
    7.     }
    8.     CombatMessage lCombatMessage = rAction.Message as CombatMessage;
    9.     if (lCombatMessage == null)
    10.     {
    11.         return;
    12.     }
    13.  
    14.     lMotion = mMotionController.ActiveMotion;
    15.  
    16.     //check if we are idle
    17.     if (lMotion.Category == EnumMotionCategories.IDLE || lMotion.Category == EnumMotionCategories.UNKNOWN ||
    18.         lMotion.Category == EnumMotionCategories.WALK)
    19.     {
    20.         //if idle
    21.         mMotionController.ActivateMotion("BasicMeleeBlock",0);
    22.         lCombatMessage.Damage = 0;
    23.         lCombatMessage.ID = CombatMessage.MSG_DEFENDER_ATTACKED_BLOCKED;
    24.      
    25.     }
    26. }
    Basicly this should block each incoming attack no matter what

    Then i have added this to my character:

    upload_2017-10-29_15-56-21.png

    When i run this and get hit my character does not take any damage but the block motion never run.

    Can you tell me what i might have missed?
     
  14. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I believe it's because you changed the combat message state to
    CombatMessage.MSG_DEFENDER_ATTACKED_BLOCKED.

    That means that the act of blocking has already occurred. If you leave it at
    CombatMessage.MSG_DEFENDER_ATTACKED

    The Basic Attacked Reactor should pick it up and allow the normal logic to go through.


    As an alternate you could change the combat message state to
    CombatMessage.MSG_COMBATANT_BLOCK

    That will force the Basic Melee Block motion to activate. This approach can be used with NPCs to force them into the block state. However, you'll have to send them a CombatMessage.MSG_COMBATANT_CANCEL message to have them come out of it.


    Let me know if that works.
     
  15. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    Still doesnt work.

    It does goes into Active however the motion doesnt run:

    upload_2017-10-29_16-32-40.png
     
  16. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    If I had to make a second guess it would be that the phase or form values aren't correct. So, the animator isn't triggering the transition.

    You'll have to email me your project. You've just got too many customizations for us to go through on the forums.
     
  17. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    @Tryz I'm trying all the latest updates for the first time, but can't quite get the Archery pack to work. I followed the quick start instructions as usual and everything seemed to go well. However, in the demo scene after setting up the pack and pressing play, the y-bot player doesn't actually equip the bow and doesn't perform any attack animations either. Here is what he looks like when I press 2 to equip the bow:

    upload_2017-10-29_21-28-0.png

    And when I hold down the right mouse button, his upper body just slowly turns to the right.

    [EDIT]
    I guess it's all irrelevant. I just added the Archery pack to my own character and it works just fine there. Not sure why the demo scene didn't work.
     
  18. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I've got a couple of thoughts:

    1. About 2 months ago Mixamo changed their animation names. I posted about it, but I know that can get lost quickly. They no longer use the "YBot_" in the front. So, you'll want to make sure you're using the latest pack from Mixamo.

    2. I updated the animator, but my tests are working. I'm wondering if there may be a conflict between your existing project and my animator... maybe Unity didn't import mine correctly.

    I did an import into a new project and everything seemed to work fine. I'll get rid of my old .meta files and update the videos to represent Mixamo's new names. I left the old .meta files in case someone needed them, but I think it's time to clear them out so there's no confusion.
     
  19. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Interesting. I had the YBot archery pack saved off for future use and just used that rather than downloading again. Do I really need to download a new version and do that process again?

    [EDIT]
    I just re-downloaded and will do it again. I think there were some other issues so hopefully this will fix all that.
     
    Last edited: Oct 30, 2017
    Tryz likes this.
  20. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Unfortunately, this is the price of using Mixamo's free animations. Fortunately, they've only done this once in the last year.
     
  21. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    No worries. Once I get it in there I'm just going to convert over to Riko's archery animations anyway, but still better to have the basics working first.
     
    Tryz likes this.
  22. RecursiveRuby

    RecursiveRuby

    Joined:
    Jun 5, 2013
    Posts:
    163
    Hey,

    Could I maybe get a brief explanation on how to use stances properly? I think I've seen it mentioned in one of your videos once but I can't recall which one and there is a lot to go through looking for it. Basically how should I change stance? In my motion it is causing issues because its ensuring its not in the traversal stance (I just copied some code from another motion and modified it to suit my needs) so in Activate I just added

    mActorController.State.Stance = EnumControllerStance.MY_STANCE;

    Would you consider this proper usage of changing the stance? I notice you change stance when switching the weapon but would you consider it equally good practice to change stance within a motion?
     
  23. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I talk about it here where I go over the Actor Core.

    Think of "stance" as the overall character state-of-mind. Typically a character is simply walking or moving (traversal) or maybe they are in melee combat, in ranged combat, sneaking, etc. I use the stance variable in AI and motions to figure out the general state of the character.

    "Form" is a more refined concept. If the character is in a "melee combat" stance, the "form" defines exactly how that stance will be animated... two handed sword, dual daggers, sword and shield, etc.

    I change them when equipping weapons sets because that make sense to me. If you have your sword and shield in hand, you're probably in a "melee combat" state-of-mind. Of course that isn't always true, but it typically is.

    Changing the stance in other motions totally makes sense. For example, if your character starts swimming it doesn't really matter if they have a sword and shield in hand... they are swimming. Feel free to change the stance in motions, but sometimes you may need to reset the stance or form when you leave the motion. It really depends on what you're creating.

    I then use the stance variable to limit which motions can work. For example, if you're not in a melee combat stance than even if you hit the 'attack' button I won't try to run the Basic Melee Attack motion. If you're not in a swimming stance, I won't attempt to run any of the swimming motions.

    In the end, stance and form are just integers. So, you can make them whatever you want. I try to reserve some values for me and the motion packs. However, you can set them for anything and any reason as long as it matches with my motions or custom motions you create.

    Hopefully that makes sense.

    Here's my existing Stance and Form IDs.
     
    Last edited: Oct 31, 2017
    RecursiveRuby and tchris like this.
  24. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    Hey Tim.

    I was wondering the helper funktions like saferaycast Can they be used by the NPCs? And is it possible that you can provide a link to the documentation on these functions i cant seem to find Them :)?
     
  25. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Absolutely. In fact, you can use a lot of my components (collision detection, raycasts, graphics manager, etc) for things outside the PC/NPCs. I use them sometimes to just test Unity itself.

    I don't provide external documentation on the code because you can get all that from your IDE's Object Browser. I talk about the Object Browser in the MC Guide (page 28):
    http://www.ootii.com/Unity/MotionController/MC2Guide.pdf

    The Object Browser in your IDE will show you all my objects, properties, functions, comments, etc and it's always accurate. With external documentation, it can become out of date quickly.
     
    TeagansDad likes this.
  26. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    You say for testing. is the functions not a good idea to use in production mode?
     
  27. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    They are fine to use in production mode. I just meant to make sure Unity components were doing what I expected.
     
  28. RecursiveRuby

    RecursiveRuby

    Joined:
    Jun 5, 2013
    Posts:
    163
    Ah I totally forgot about the Actor controller documentation. That makes a lot of sense, thanks! :)
     
    Tryz likes this.
  29. MarkusGod

    MarkusGod

    Joined:
    Jan 10, 2017
    Posts:
    168
    Hello again! I've built a simple tree with behaviour designer, everything works well except character is always goes to the player.
     
  30. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Very cool! :D

    The MC won't cause the character to move to a target on its own. Something has to tell it to move their. It could be a couple of things:

    1. You accidentally left the SS_NPC_Controller_v2 script on the NPC.
    2. Your tree is telling the NPC to move to the target when you don't think it is.
    3. You're not clearing any target that you're setting.

    I'd double-check all of those.
     
  31. MarkusGod

    MarkusGod

    Joined:
    Jan 10, 2017
    Posts:
    168
    Oh, sorry I express my thoughts in a wrong way.
    Enemy character behaviours like expected, but if you look at the foot, it always walks forward, no strafing and no walking backwards.


    EDIT: Ok, I don't know what was causing the issue but, resetting MC done its job.
     
  32. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Ah... I see it in your video now. The animation is always walking forward.

    :D

    The issue was probably that you are using "Basic Walk Run Pivot" which is a "forward only" movement. You have "Basic Walk Run Strafe" in your motion list, but I'm wondering if it had an "Action Alias". If so, that means that motion will only be active when a button is pressed.

    Remove "Basic Walk Run Pivot" and make sure "Basic Walk Run Strafe" doesn't have an "Action Alias" and you should get what you want.
     
    MarkusGod likes this.
  33. LarryIRL

    LarryIRL

    Joined:
    Mar 31, 2014
    Posts:
    15
    Hi Tim,

    I just purchased & downloaded the Sword & Shield motion pack & was following along with the tutorial video/ documentation on adding the animations from Mixamo.

    They seemed have fixed the issue of there being animations missing.

    When I opened my zip file there was 51 animations inside & upon importing them into Unity they seem to have the correct naming that corresponds to what you put in the PDF file.

    The Demo scene is working fine too.

    You still need to copy the meta data across but apart from that it's pretty easy.

    Just thought I'd let you & others know.

    Thanks for the great Unity assets.
     
    Tryz and rubble1 like this.
  34. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    Hey @Tryz

    Could you give some insights into how i make my NPC's run while their weapon is equipped ?
     
  35. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Thanks for the heads up. The documentation should reflect their fix, but I'll double check. :)
     
  36. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Let's take my Sword & Shield Motion Pack as an example...

    Short Answer:
    1. Make sure his Basic Walk Run Pivot motion has "Default to Run" checked.
    2. On the SS_NPC_Controller_v2 component increase his "Movement Speed" to 5.

    Insight:
    In that demo, the NPC has the Actor Controller's "Use Transform" checked. That means movement actually occurs because of changing the NPC's transform.position in code (outside of the MC). I do that in the SS_NPC_Controller_v2 AI example component I provide.

    On that component, there is a "Movement Speed" property. The default is about walking speed (1.9). I use that speed to change the transform.position over time.

    The MC has a property you can access in code called MaxSpeed. This is the expected speed when running and by default it's set to 5.6.

    When the NPC moves, I do a calculation 1.9 / 5.6 = .33. This value then determines if we stand (0.0), walk (0.5), or run (1.0).

    So, to make the NPC run. We just need to make sure his Basic Walk Run Pivot motion has "Default to Run" checked. Then, we need to increase the NPC "Movement Speed" to something like 5.6. Now that math (5.6 / 5.6 = 1.0) is closer to 1.0 and the NPC will run.

    I took you the long way around. This way if you're doing NPCs a different way you can understand how it works under-the-hood. :)
     
    Censureret and TeagansDad like this.
  37. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    @Tryz thank you so much for your response.

    By the way i just updated to unity 2017.2 and i get some issues with the "EasyInputSource":

    Assets/ootii/EasyInput/Code/Input/InputManager.cs(1891,66): error CS0619: `UnityEngine.RuntimePlatform.OSXDashboardPlayer' is obsolete: `Dashboard widget on Mac OS X export is no longer supported in Unity 5.4+.'
     
  38. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Please update to the latest version (1.87).
    Easy Input

    I fixed that with the October release by commenting out lines 1890 and 1891. I've just confirmed that everything is working with no errors.

    In October I set the minimum version of my assets to Unity 5.5.0f3 to avoid some other backwards compatibility issues. If you upgraded from a version prior to Unity 5.5 it's possible the Asset Store didn't show you the new version. It will now with Unity 2017.
     
    Censureret likes this.
  39. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Has anyone tried to use MC with non-humanoid characters? Is it even possible? For example, if I wanted my player character be a wolf or dinosaur or whatever. Would it just be a matter of changing the animations or are there other concerns that would make this idea problematic?
     
  40. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    It works just as well with non-humanoid characters. You may need to build some custom motions, but you can get a lot of mileage out of the "Basic" motions. I've tried it out with some models from Infinity PBR and Protofactor.

    Main issue is going to be the relative lack of animations compared to what's available for humanoids. Unless you can create some of your own animations.
     
    BackwoodsGaming, Tryz and magique like this.
  41. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    @Tryz i bought your camera controller a while back and now i need "more than the standard from it" if you take a look at the following video:



    is it possible to make the camera work like that in the combat? using both your sword and shield and camera controller?
     
  42. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
    i setup today a creature complete with motion controller and nodecanvas is just a basic start but i handel all complete over the motion controller.
    im not complete happy about the result need a lot of improve the combat feels not really smooth at the moment and i think a automatic combat lock (auto aim) will be really i will test tomorrow, but my main goal is to handel all over the motion controller and nodecanvas and its true you can use all creatures what you want.

     
    Tryz, hopeful and magique like this.
  43. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Yes, but it will require some work. We just have to remember that the Witcher 3 had an $81 million dollar budget and 240 people working on it. :)

    The CC allows us to control the view, assign targets, etc. So, what we'd need is some intermediary that determines what those targets are and when they should change. The Combatant does that in a simple way, but you could create something a lot more advanced.

    We can also use the different motors to change the views as needed.

    So, the raw tools are there. For something as advanced as what we see in Witcher 3, you just have to provide the "glue" that puts those tools together to work exactly how you want them to.
     
  44. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    I see! In your standard setup you have a Fixed camera motor and a follow camera motor.

    Would you use any of those or would you have to create your own?
     
  45. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I think you can use the motors that I include. There are some functions that the "intermediary" I talked about can use to force the view like CC.SetTargetForward() and CC.SetTargetYawPitch().

    Between the existing motors and these functions you should be able to control the camera how you want. Worst case there would need to be a change to an existing motor to follow the anchor while looking at a separate target. I haven't studied the Witcher 3 camera long enough to know if that's what is happening.
     
  46. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Happy to report that the Shooter Motion Pack is officially done!



    I need to create some marketing material and should submit it to Unity tonight.

    Thanks to the awesome beta testers for keeping me on my toes! :D
     
  47. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Congrats!!! Nice work. I'm sure it'll and up in my library of way too many assets to ever realistically use, but it might be one I ACTUALLY use. :)

    Other subject...
    Is there a way to rename simple motions so I don't have multiple "simple motions" on my motion controller? Maybe just duplicate the script and rename?

    Also, let's say I have three death animations to choose from randomly all with the same stance. I'll handle the logic with my behaviour designer ai but what's the best way to trigger one or the other in mecanim? I was looking at simple motion but not sure how best to do it without three separate simple motions. Thx!

    Also with shooter motion pack done do you plan on revisiting the AI with arbitrary rotation with unity's new nav mesh system? Happy to help bug test it.
     
  48. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    hahaha... I understand. :)

    In the motion list, the field next to the type name allows you to name the motion. You can use this name with the MC's GetMotion() function too.



    In the animator, you could add the alternate animation. The transitions would use different L0MotionForm values.

    The tricky part is to set the form value on the motion (BasicDeath.Form = xxx) before the motion activates. This value would then be passed to the animator and trigger the matching transition.

    I'll look into that first. However, if it become a hairy mess I may punt for a bit.

    What I really want to do is put together some "game clones" first. I get way more questions about "How do I create a game like X" than I do about Unity's new nav mesh.

    Not that I plan to ignore it, but as a one-man-show I have to prioritize. :(
     
    christougher and TeagansDad like this.
  49. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    @FargleBargle has been creating some awesome custom guns with the gun components in the Shooter Motion Pack. Way cooler than just regular ol' bullets. :D

     
  50. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Just wondering is there a motion for stepping up from crouching cover to shoot over low cover, like at 0:18 in the video?