Search Unity

Motion Controller

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

  1. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    There's a couple of things in the works:
    1. The free climbing motion/pack
    2. A different kind of AI solution
    3. Support for 2018 features

    The big challenge is simply time. I'm in the middle of a large contract with a major entertainment company in Orlando ;)

    Between that, support, and summer time with the family I'm not getting much time on the 3 tasks above. I will get to them, but it's just taking longer than planned. :(
     
    TeagansDad and recon0303 like this.
  2. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    ha, ya I know the time feeling, never enough in the day. Ya I understand completely, I adopted two toddlers, as of late. So being a stay at home dad, and professional game dev for a AAA company part time, and working on my new Steam game, and the Android game when I can plus I help my wife run our business . so I completely understand. lol. So no worries, I was just curious if there was anything going on, I been out of the loop and didn't want to read a ton of pages since I been gone. anyways Thanks for the update!
     
    TeagansDad likes this.
  3. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    @Tryz When the animation moves you get the streaks. I noticed when I am moving or there is too much recoil that's when I get the streaks also. If I don't aim, don't move and have little recoil - that's when I didn't get the streaks.
     
  4. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    @Tryz I was having all kinds of shaking issues with my model when shooting the weapon and I gotta tell you, when I figured out how to handle it with all those IK aiming properties - A+++ well done Ralphie ;):) Amazing!
     
    Tryz likes this.
  5. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    The streak is either the bullet hole on an object with a non-uniform scale or a stretched mesh. I haven't had time to play with it yet, but I will. If you want you can email tim@ootii.com a small project and that will make sure we're talking about the same thing.

    Thanks. Unity's layer blending is a bit rough and dealing with unknown skeletons from different artists is tricky too. So, hopefully the IK options help handle all those unknowns.
     
  6. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    I'll try and get you something. I was getting frustrated with my model and the IK so I disable the chest in the UpperMask. The issue I was having there was everytime I shot with the pistol the model jerked left. I fixed it with some of the settings but then it through something else off.
     
  7. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    Separately, I am trying to figure out the event system and I don't really know how to trigger the reload sound on a weapon reload. You include an audio file and an animation trigger but can't really figure out how to tie in to the BasicReload::Reload()
     
    Last edited: Jul 5, 2018
  8. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hmmm... I don't have that as a feature.

    So for now you'd have to add that. I'd probably put that in the Magazine component of the gun similar to how I did on the Muzzle for the "Fired" audio.



    So, the BasicGunMuzzle.cs takes an audio clip and then plays it in the OnFired() function (line 152).

    We'd do something similar with BasicGunMagazine. Since there's no OnReloaded() (maybe there should be), I'd just add the sound logic in the Quantity property setter when the quantity increases. Something like this:

    Code (CSharp):
    1.         public int Quantity
    2.         {
    3.             get { return _Quantity; }
    4.  
    5.             set
    6.             {
    7.                 if (value > _Quantity)
    8.                 {
    9.                     if (mAudioSource != null && _ReloadedAudio != null)
    10.                     {
    11.                         mAudioSource.PlayOneShot(_ReloadedAudio);
    12.                     }
    13.                 }
    14.  
    15.                 _Quantity = value;
    16.             }
    17.         }
    Of course right now there is no "mAudioSource" or "_ReloadedAudio", but I'll add that to my to-do list. Until then, it shouldn't be too hard to create your own CustomMagazine that does this. Just check out BasicGunMagazine.cs and you'll see it's 24 lines of code.

    Email tim@ootii.com if you need more help.

    [EDIT]
    I just added it as a feature. If you email me, I'll send you the files that I modified.
     
    Last edited: Jul 8, 2018
  9. eblumrich

    eblumrich

    Joined:
    Nov 12, 2015
    Posts:
    105
    Hi.

    Due to some strange stuff that happened (I'm still trying to figure out what,) I had to re-build my third-cat controller from scratch.

    I followed the instructions, and it all works, except for- well, the cat does not turn, or move backward.

    Pushing any directional key sends the cat walking forward.

    Any reason why this should be happening?
     
  10. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Unfortunately, I need more info.

    Which motion you're building off of?
    Did you use my motion and replace the animations or are you using a custom motion?
    Do you have a custom animator?

    Since you're probably using root-motion, I'm guessing that your animator isn't activating any of the other transitions.

    It sounds like everything was working before. So, it will be a setup issue. I just don't know what setup you're using. :(
     
  11. limpin_jezus

    limpin_jezus

    Joined:
    Nov 20, 2015
    Posts:
    18
    Not sure if it is because I am tired or have just been staring at it too long, but I am stumped. I am simply trying to use the Bow - Walk Run Pivot, Bow - Walk Run Strafe motions instead of the Basic Walk Run Pivot and Basic Walk Run Strafe motions. If I enable the Bow motions, I get no animations. I see the State Machine transition is triggered on l0MotionPhase 31100, but for the life of me I can't figure out where to set that parameter. I know I am going to face-palm when I find the answer.
     
  12. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hi Tim,
    I'm considering to use actor controller and motion controller for my animal AIs.
    But concerning the performance, how many motion controllers can there be in one scene?
    My animal AIs can be 20 - 50 activated at the same time, how much will it impact the performance if they all use motion controller for animation and motion controls?
    I'm also trying to use Behavior Designer and A* Pathfinding Project Pro to cover the logic and navigation for my AIs, how do they work with motion controller in terms of performance.
     
  13. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Please don't use those motions. I've phased them out for the "basic" approach. If I remember correctly, the 'Packs' tab doesn't even set them up any more.

    I've kept those files in for older users, but I'll be removing them during the next update. This is true for the SSMP_xxx motions too.

    The "basic" motions are way more flexible.
     
    TeagansDad likes this.
  14. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    This was my last stats on my old PC:

    9/28/2016 - U5.4.1f: 100 Unity Default + MC = 105 FPS (at edit-time)

    This was 100 characters all actively walking around in the same area. I believe my PC was an i5 with 16 GB and an Nvidia 960.

    All I did was create an MC character and then duplicate him 100 times. I'd recommend you do a similar test on the hardware you're spec-ing for. Just remember that rendering all those character's has its own hit on performance.

    If they are being run by AI, you can increase performance by disabling the ground collisions and movement. You typically don't need that if the AI is controlling placement.

    I haven't performance tested Behavior Designer or A*. Whatever over-head they create would be added to the MC stats.
     
    Last edited: Jul 11, 2018
    Harekelas and TeagansDad like this.
  15. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,294
    Free climbing motion pack :)
     
  16. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I haven't had time to continue testing. So, it's delayed.

    (That's what I get for talking about things ahead of time ;) )
     
  17. limpin_jezus

    limpin_jezus

    Joined:
    Nov 20, 2015
    Posts:
    18
    Thank you, sir. the further I went down that rabbit hole, the more confused I became. I'll leave it with one other question. One of the motions that are set up for the Archery Pack is Bow - Dodge, but the Dodge blend tree has 5 undefined/empty motions. Am I to assume this also is legacy and will be phased out?
     
  18. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,294
    @Tryz no pressure from me.
    Been here for many years and know that good stuff take some time.
    That is why i have all of yours!
     
    Tryz, hopeful and TeagansDad like this.
  19. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Does the climbing pack support non-90-degree edge climbing?
     
  20. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Yes. I felt it just never ended up being really useful.
     
    limpin_jezus likes this.
  21. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    No. I've had lots of people request a 'Breath of the Wild' style climbing, but this isn't that.
     
  22. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Any ideas on how to achieve a similar climbing system to that?
    Also, I found a procedural animation or motion open talk by the developer of Overgrowth, very intuitive methods on motion controls. Take a look here:

    I'm thinking how can I achieve this through motion controller, 13 key frames to achieve a very physical accurate procedural animation set.
     
    rubble1 likes this.
  23. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Awesome video and I love the procedural animations.

    This would fit well with the MC. Since each motion is a mini-Monobehaviour, they have their own Update() functions. You'd put your logic there. This gives you a 'protected' space to add procedural animations while still allowing other actions to use baked animations.

    Totally doable and something worth playing with.

    If you break it down into pieces, there's really nothing the MC hasn't done before:
    1. Detect climbable surface
    2. Determine if we should 'attach' or not
    3. Orient character based on the surface
    4. Adjust movement based on the orientation of the character
    5. Hand and foot IK
    6. Polish

    When I tackle a motion like this (or any project), I break it down into pieces. In fact, this is exactly how the video walked us through the procedural movement. One step at a time.
     
    hopeful likes this.
  24. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    I'm just scratching my head trying to figure out how to use a custom curve to blend two key frames together, and the wheel function to fine tune the steps interval for walking/running by speed.
    Can sampling the animation let me extract keyframe information for each bone? If so then I can use some geometry calculations to interpolate between two frames. But wheel really got me choked. Any ideas?
     
  25. limpin_jezus

    limpin_jezus

    Joined:
    Nov 20, 2015
    Posts:
    18
    I'm getting the following error when equipping the bow on a custom character with Mount Points. The instanced version of the bow does not reparent to the MP_LEFT_HAND as expected:

    Setting the parent of a transform which resides in a prefab is disabled to prevent data corruption.
    UnityEngine.Transform:set_parent(Transform)
    com.ootii.Actors.MountPoint:ChildTo(MountPoint) (at Assets/ootii/MountPoints/Code/Actors/MountPoints/MountPoint.cs:320)
    com.ootii.Actors.MountPoints:ConnectMountPoints(MountPoint, MountPoint) (at Assets/ootii/MountPoints/Code/Actors/MountPoints/MountPoints.cs:299)
    com.ootii.Actors.MountPoints:ConnectMountPoints(String, String, String) (at Assets/ootii/MountPoints/Code/Actors/MountPoints/MountPoints.cs:433)
    com.ootii.Actors.Inventory.BasicInventory:CreateAndMountItem(GameObject, String, Vector3, Quaternion, String, String) (at Assets/ootii/Framework_v1/Code/Actors/Inventory/BasicInventory/BasicInventory.cs:1156)
    com.ootii.Actors.Inventory.BasicInventory:EquipItem(String, String, String) (at Assets/ootii/Framework_v1/Code/Actors/Inventory/BasicInventory/BasicInventory.cs:397)
    com.ootii.MotionControllerPacks.BasicItemEquip:CreateItem() (at Assets/ootii/MotionController/Code/Actors/AnimationControllers/MotionController/Motions/BasicItemEquip.cs:413)
    com.ootii.MotionControllerPacks.BasicItemEquip:OnAnimationEvent(AnimationEvent) (at Assets/ootii/MotionController/Code/Actors/AnimationControllers/MotionController/Motions/BasicItemEquip.cs:336)
    com.ootii.Actors.AnimationControllers.MotionControllerLayer:OnAnimationEvent(AnimationEvent) (at Assets/ootii/MotionController/Code/Actors/AnimationControllers/MotionController/MotionControllerLayer.cs:713)
    com.ootii.Actors.AnimationControllers.MotionController:OnAnimationEvent(AnimationEvent) (at Assets/ootii/MotionController/Code/Actors/AnimationControllers/MotionController/MotionController.cs:2493)
     
  26. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Based on the Unity error message:
    It seems like you may be trying to set a 'scene object' inside of a 'prefab object'. You can't do that in Unity because the prefabs live in the project and not the scene. Therefore the prefabs don't have access to objects in the scene.
     
  27. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    For a client, I'm using some code like this (at edit-time) to extract animation curves from an animation:

    Code (CSharp):
    1. RuntimeAnimatorController lController = lAnimator.runtimeAnimatorController;      
    2. AnimationClip lClip = lController.animationClips[0];
    3. string lPath = AnimationUtility.CalculateTransformPath(rMule.transform, lAnimator.transform);
    4. EditorCurveBinding lPositionX = EditorCurveBinding.FloatCurve(lPath, typeof(Transform), "m_LocalPosition.x");
    5. AnimationCurve lCurvePositionX = AnimationUtility.GetEditorCurve(lClip, lPositionX);
    I'm not sure if it works at run-time.

    Once you have the two AnimationCurves, using a third curve to blend the values is just a multiplication:
    FinalValue = (Curve1 * x) + (Curve2 * (1f - x)); // pseudo code

    You'll just have to see if you can get the curves at run-time. If not, you may need to store the values at edit time.

    I'd just start by researching "extract animation curve from animation at runtime".
     
  28. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    The AnimationUtility class is editor only, can not be used in runtime. An extracting animation curve in runtime can be very performance overhead. There are some new API in Playable since unity 2017, it seems to exposed some properties of an animation and can use it to script a custom animation controller, but I'm still tinkering on it, maybe you can check this out, too.
     
  29. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    While I find this super interesting, my plate is really full. I'd like to bump this to the top, but I can't.
     
    Last edited: Jul 14, 2018
  30. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    @Tryz Hopefully I've just missed something but I have just added the simple "Basic Walk Run Strafe" motion to my motion layer and when I move the animator L0MotionPhase never gets triggered to 3100, i.e. the motion never gets triggered. The other Basic motions seem to get triggered just fine though. Any thoughts?
     
    Last edited: Jul 18, 2018
  31. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    A lot of times, the BWRS motion is used just for shooting and aiming. So, there are properties that limit when the motion activates. I'm thinking you may have those properties set.



    Activate With Target = Motion won't activate unless the Combatant component is targeting someone.
    Activation Alias = Motion won't activate unless a key (ie right-mouse-button) is held.
    Valid Actor Stances = Motion won't activate unless the character is in that stance.

    Make sure none of these are set and the priority of the motion is higher than any other walk/run motion.

    That should do it.
     
    jnbbender likes this.
  32. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    191
    Hi Tim,

    I know you are really busy right now but do you have any rough estimate on when your AI package might be released? Are we talking a month, 6 months, 1 year? I know its difficult to nail down a time estimate and things can certainly changed in the future but I am just curious. I only get a couple of hours a week to work on this stuff and trying to decide if i should wait for your package or try to use another one or try to use behavior designer/node canvas, or try to program my own or, or, or....

    Thanks in advance.
     
  33. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I totally understand. Given my current pace, I'd say 6 months.

    The work won't take that long, but getting to the work is another story. :(
     
    rubble1, TeagansDad and KeithBrown like this.
  34. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    254
    Hello



    if you look the video i pressed and released immediately the button
    i want the character only rotate, but i looking something smooth (not like the end of video)
    can do that?
     
  35. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    @Tryz
    Regarding the Shooter Pack: What is the best way to get the location of the Reticle? Explanation (See the picture below): When working with the 3rd Person Follow camera and I Right-Click to Aim very often the player's weapon does not align with the Reticle. I put a simple script on my player and using the MotionController I was going to call Lerp SetTargetRotation, if I need to. I attached that to the Camera's Motor Activated Event but I need to rotate my player to something.

    Any ideas?
     

    Attached Files:

  36. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    Please try to explain a little bit more. Do you want the quick, stand in place, rotation or not?
     
  37. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    254
    i want something like this

    when i press and release immediately the button
     
  38. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hi @claudius_I ,

    The Walk Run Pivot motion has an option called 'Tap to Pivot'. If you check that, you can tap the WASD keys or left Xbox controller stick to have the character pivot like in your video.



    I do the pivot in 90-degree increments based on the input relative to the camera direction. This is similar to Tomb Raider and Assassin's Creed.
     
  39. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    What I do is add both the Basic Walk Run Pivot (BWRP) and Basic Walk Run Strafe (BWRS) motions to the character. On the BWRS motion, I set the 'Activation Alias' property to the key/mouse press I use for aiming:



    What this does is allow the BWRP motion to be the normal movement motion when not aiming. This creates a Tomb Raider kind of movement where the character can face any direction.

    When the aiming button is held (ie the right-mouse-button), the BWRS motion takes over and forces the character's rotation down the direction of the camera. Rotating the mouse (while holding the aim button) rotates the character.

    You may want to play with the options on Basic Idle to get what you want too. I believe I added 'Action Alias' on the idle as well.

    It's just the center of the screen + an offset based on the Reticle component.



    In the future, it may be cool to allow the reticle to move like some games do. However, my simple reticle doesn't do that. It just finds the center of the screen and draws it.
     
    TeagansDad likes this.
  40. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    @Tryz Thanks for all your attention is this forum. I am having, hopefully my last character issue. When in the Shooter poses my players hands don't seem properly resolved by the IK. My model seems to be alright but as you can tell from the picture there seems to be an IK issue. I have added the Support Transform to the Pistol prefab and played with that a bit and I played around with the Avatar. Any ideas?

    Thanks.
     

    Attached Files:

  41. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I talk about the Left Hand IK a bit on Shooter Motion Pack Tips & Tricks.

    You really want your animation doing the heavy lifting. In the case of a pistol, it should already have both hands pretty close together.

    The left hand IK is basic and will just rotate the end of the lower left arm bone so it gets as close to the support transform as possible. It won't move or rotate the upper arm from the shoulder and therefore the elbow (which is the start of the lower left arm bone) won't move from where it is in the animation.

    One thing to look at is that the lower left arm bone probably doesn't end in the center of the hand, but more the wrist. That means you want to offset the support transform from the pistol. You want to position it where ever the lower arm end moves to that makes the hand look like it's as close to the pistol as possible.

    Again, the animation should be doing most of the work. This is just a tweak.

    In your picture, the elbow seems pretty far away from the pistol. Is that a custom animation?
     
  42. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    No that's the standard PistolIdlePose
     
  43. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    It must have something to do with the character's bone lengths then. Here's what it looks like with Unity's character:



    When Unity uses the humanoid rig to transfer animations, it's still limited by your character's bone lengths and bind rotations. In that case, you'll have to use Unity's avatar tool to adjust the humanoid rig to your character. I've had to do that with other models as well.

    https://docs.unity3d.com/2017.4/Documentation/Manual/ConfiguringtheAvatar.html


    It's not fun, but it's a standard thing to do when one artist isn't making all your characters, skeletons, and animations.
     
  44. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    Thanks
     
  45. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    254
    hello again :)
    i have a new problem
    i started create a cutscene, but when i try to rotate the character (set rotate or look at) the character back to original pose

    i dont know to fix that

    thanks
     
  46. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    The MC (and under-the-hood the Actor Controller) manage the position and rotation of the character. If you want to manage it yourself, you've got a couple of options:

    1. Use the Actor Controller's functions:
    AC.SetPosition()
    AC.SetRotation()

    2. On the Actor Controller, check the 'Use Transform' option. That will allow you to control the character by setting the transform properties. However, the movement from the MC will be totally ignored.

    Check out this video at 13:44.

    3. Disable the MC and the Actor Controller.

    Typically I do #1 for small adjustments. For cut-scenes you may want to use #2.
     
  47. crazymonkey7787

    crazymonkey7787

    Joined:
    Oct 1, 2017
    Posts:
    4
    First, let me say that I absolutely love your assets, very powerful.

    Second, my dilemma. I am using the sword and shield motion pack, the basic melee attack motion. I added a left hand and right hand jab from FightingAnimsetPro, I set the animations events (BeginFOA, Hit and EndFOA) for each.. The only modifications I made to the basicmeleeattack.cs was adding an additional actionalias, one for left hand and one for right hand (setting bools to a reactor script). I created a reactor script that activates pre attack and checks which hand was activated via the basicmeleeattack.cs to play a specific animation, letting me do left and right hand attacks separately. I created two wapons prefabs, right fist and left fist, they both have rigidbody and a box collider with the required settings. I am using your inventory system to equipped the created weapons. Everything so far works great, equipping works and animations work. The problem that I am having is when the animation plays the collider isn't activated during BeginFOA. I did a little test and used the your slash animation for the right hand and still having the fists prefabs equipped, i get no issues with the collider turning on and off. What could be my problem? BTW, everything is being done in the demo_SSMP.

    Thank you
     
  48. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Thanks and congrats on all you did. Creating fist fighting from the Sword and Shield Motion pack is awesome! :D

    It sounds like you have the animation events in. Those are going to be key.

    One thing to watch out for is that your animation event isn't occurring during a transition.

    Say you're in the idle animation and then you transition into the right-hand punch. If the right-hand punch animation event (BeginFOA) occurs during that "idle-to-right-hand-punch" transition, the right-hand punch animation event won't fire. Unfortunately, that's just the way Unity works.

    It sounds like you did everything right. So, that would be my only guess.
     
  49. crazymonkey7787

    crazymonkey7787

    Joined:
    Oct 1, 2017
    Posts:
    4
    I adjusted the idle -> punch to be shorter and it worked.

    Thank you. Like I said, you have some very powerful assets. I am currently working on splitting the motion into two, Left Fist and Right Fist, in order to make a randomized combo system. I already have most the work done but ran into the problem with the colliders not activating thinking that I did something wrong in the code. That is why I reverted back to your core code in the basicmeleeattack.cs to see if the problem was my code.

    Unfortunately, I have another problem. I have a collider on the right fist and left fist, a dual wield setup. When I do the right punch BeginFOA and EndFOA work perfect. The problem is when I do the left punch it doesn't activate the collider on the left fist it activates the collider on the right fist only. This is for both setups, having two motions and just using your Basic Melee Attack motion. What could the problem be?

    Thank you
     
  50. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Cool.

    hmmm.... I think I know what's going on.

    When I built the BasicMeleeAttack, I built it around the 'primary weapon'. So, when the BeginFOA event is hit, there's one weapon core this is activated... the primary one. I'm guessing this is your right hand.

    If you look in BasicMeleeAttack.cs Activate() function, you'll see I set the mWeaponCore property starting at line 413.

    At line 738, I then set mWeaponCore.IsActive = true due to the BeginFOA animation event.

    At line 756, I then set mWeaponCore.IsActive = false due to the EndFOA animation event.


    What should happen is that the attack style should have a property that says this works for the primary weapon, secondary weapon, or both. Then, I'd set "IsActive" where needed.

    As I think about it, it may even need to be more flexible than that to support things like karate (hands and feet = 4 weapon options).


    So, I think I understand the issue. You're (reasonably) asking for a feature that doesn't exist: Dual wield.

    If you follow what I said above, you could add it as a new motion or modify my BasicMeleeAttack.cs. In your case, it may be as simple as adding a "mWeaponCore2" that references the secondary weapon.

    I'll add it to my to-do list, but it's going to take some time as I'm in the middle of a couple of things. :(