Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Motion Controller

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

  1. pcg

    pcg

    Joined:
    Nov 7, 2010
    Posts:
    292
    Hey Tim, Just wanted to give you a heads up on a problem I encountered and hopefully help out anyone else who gets the error.
    I'm using the Motion Controller with Sword and shield pack + Camera Controller + Rewired.
    I knocked up a test scene as I plan on adding the character via instantiation but for now I added the character to the scene and didnt specify the Input source or the Camera Rig - both set to find.
    I had the Rewired input source added (which works fine) and the Camera Rig is also part of the scene.
    The input source on the camera controller was populated with the Rewired Input Source.

    When hitting play I got an error:
    NullReferenceException: Object reference not set to an instance of an object
    com.ootii.Cameras.YawPitchMotor.Awake () (at Assets/ootii/CameraController/Code/Cameras/CameraMotors/YawPitchMotor.cs:384)
    com.ootii.Cameras.CameraController.InstantiateMotors () (at Assets/ootii/CameraController/Code/Cameras/CameraController.cs:1310)
    com.ootii.Cameras.CameraController.set_Anchor (UnityEngine.Transform value) (at Assets/ootii/CameraController/Code/Cameras/CameraController.cs:127)
    com.ootii.Actors.AnimationControllers.MotionController.Awake () (at Assets/ootii/MotionController/Code/Actors/AnimationControllers/MotionController/MotionController.cs:718)

    The solution was to change the script execution order so that CameraController was processed earlier in the list (I changed to -1000).

    BTW Thanks for an awesome tool set. I wasnt sure if I should pay up for another 3rd person controller but its been worth every penny and by far the best I own. And I own most :)
     
    TeagansDad likes this.
  2. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    A fair amount due to root-motion, animation events, and event animation timings.

    I use these things to determine the character movement speed, direction, and when to trigger certain events. Climbing is a good example... The animation determines the movement of the character and final position. It's also used to determine when the motion has finished and it's time to move on to a new motion.

    While your server may not care about the visuals, the "data" of the animations is important.
     
    LukeDawn likes this.
  3. Tryz

    Tryz

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

    Thanks for the report and helping, but something is odd. That line (YawPitchMotor.cs:384) isn't referencing any objects (so there shouldn't be a NullReferenceException). I'm just setting one Vector3 from another.

    Can you shoot me your CC version number... it's in the Assets/ootii/CameraController/Version.txt file. Maybe you're using an older version.

    Go ahead and email it to tim@ootii.com and we'll work through this in email. :)

    Thanks! I really appreciate that. It's nice to hear the tools are working out for people. :)
     
  4. LukeDawn

    LukeDawn

    Joined:
    Nov 10, 2016
    Posts:
    403
    Would it be possible to look at things another way...
    I see there are motion files for each animation. Is it possible that these contain start/end positions so the Actor can be moved from start to end without any animations present. Is it the MotionController that does testing to see if the path from start to end is available, ie no collisions?

    Have you got skype or a discord where we could talk things over, find a solution?
     
  5. Awesumo

    Awesumo

    Joined:
    Nov 6, 2011
    Posts:
    57
    Is there a quick solution to make running jump have the option to rotate with camera like plain old jump does?
     
  6. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    251
    hi
    i have a problem
    the character doesn't move (walk, but don't move)

    ********Fixed**********:)
     
    Last edited: Mar 2, 2018
    Tryz likes this.
  7. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Unfortunately, it doesn't work that way.

    Think of motions as wrapping multiple animations and then running the code that helps to manage them. In the case of a climb, the motion tests to see if a climb is valid and kicks off the climb motion. It then tells the animator to run and responds to the delta movements each frame that come through the root-motion. In some case, there are lots of animations being managed by a single motion and those animations can have different paths. So, there's really no knowledge ahead of time where the character is going to end or even how long the animation may take. This isn't always the case, but it's pretty normal.

    When the MC gets the movement information from the animation, it sends it to the underlying Actor Controller. The AC is a low-level character controller that tries to do the moving, but it checks gravity, grounding, collision, other forces, etc. In the end, the AC determines that there's a wall and even though the animation might want us to go forward, the wall prevents movement.

    Let's stick to email. Feel free to email tim@ootii.com if you want to take the conversation there.

    Unfortunately, my main revenue maker is contract work. Email (and posts) makes it easy for me to respond between other work.
     
  8. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    It's not built that way, but you could create a custom Running Jump that does.

    In Jump, the root of the rotation comes from the OnCameraUpdated() function. In there are about 15 lines of code that does the rotation. In your AwesumoRunningJump.cs, you could copy that function over.

    Search for "OnCameraUpdated" in Jump.cs and you'll see how I register/unregister it so the function gets called. Do that too.

    I'm not sure what your programming skill is, but it shouldn't be hard to do at all. If you want to try it, just send an email to tim@ootii.com and I'll help how I can. I'll also add the feature to my list, but I'm a bit buried right now. So, it's not something I can promise to do.
     
  9. pcg

    pcg

    Joined:
    Nov 7, 2010
    Posts:
    292
    @Tryz Email sent. Thanks for the quick response.

    I have a question on how to set up the following.
    I'm looking to create a twin stick shooter where the camera follows the player but the camera does not rotate.
    The player should be able to use one or two sticks.
    For example they will only use one stick if they are exploring and two sticks when in combat.
    When they use only the left stick the motion used will be BasicWalkRunPivot and the player will face the direction they walk in.
    When they use two sticks the motion type needs to switch to BasicWalkRunStrafe and the left stick will control the players movement direction while the right stick will control the direction the player faces.

    So far I have the BasicWalkRunPivot working perfectly when using the left stick.
    I can also switch to the BasicWalkRunStrafe when the player also uses the right stick. I do this by activating with target. I have a game object which im using as the target and I place this in the forward direction of the character. The target moves and rotates as you move.

    The problem I have encountered is that when I'm in BasicWalkRunStrafe and the player presses up on the move stick (left stick), the character moves in the direction he is facing and not up as per the camera direction.

    I do have a work around in the form of a change to MotionController.cs ProcessUserInput but this seems to go against the modular approach of the MotionController itself so I was wondering if there was a better way.

    Thanks.
     
    Tryz likes this.
  10. Awesumo

    Awesumo

    Joined:
    Nov 6, 2011
    Posts:
    57
    I got it to *almost* work, but the camera goes from rotating the character to rotating around the character after a few frames. I sent you the file. Hopefully it is something simple I am just not seeing. Actually, now that I think about it, is there a call in there that forces the camera to enter flyaround mode or something because that was the normal behavior before?
     
    Tryz likes this.
  11. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Right. The Basic Walk Run Strafe expects the character to be facing the direction of the camera. So, I expected the character direction to be the camera direction and pressing up would have the character move "forward".

    What you're describing about facing the target object is actually much closer to the Basic Walk Run Focus. That was built as a top-down version, but it allowed the WASD (left stick) to move while the character faced the mouse (right stick). Play with my demo and see if it is close.

    Yeah, I really steer people away from modifying the MC. If we have to, I'll make it a feature for everyone. Motions is the way to go. :)

    I'll check the email.
     
    pcg likes this.
  12. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Just saw your email. I'll check it out. :)

    BTW... thanks for the Unity Order ID. That does help!
     
  13. pcg

    pcg

    Joined:
    Nov 7, 2010
    Posts:
    292
    Yup, that's exactly the motion I was looking for. I should be able to use Basic Walk Run Focus as a starting point for my own motion with only a few minor tweeks needed for the targeting.
    Thanks for the help.
     
    Tryz likes this.
  14. SwingNinja

    SwingNinja

    Joined:
    Mar 13, 2017
    Posts:
    17
    Hi,

    I've been trying to figure out how to replace some animations. It seems like I can only do it from the Animator (tried with Unamerd Idle Pose and worked), but not the ones that needs to be re-defined from the inspector panel.

    For example, using your demo_interacting scene, there's the Fall motions that calls Jump-SM with some re-defined animations underneath, like JumpRise -> IdleToRise animation. When I tried to re-define it myself (JumpRise -> Death animation), it switches back to the original animation (IdleToRise).

    So, what am I missing here?

    Thanks.
     
  15. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I'm not really sure what you mean by "re-defined".

    The animator sub-state machines are just standard Unity animator sub-state machines. So, you can choose a sub-state machine like Jump-SM and see the states I have. To replace an animation, you just click an animator state and drop in your new animation.

    The "catch" is the structure. When we build motions, we typically have a sub-state machine structure in mind. Something like the Jump motion expects the Jump-SM to be structured a certain way. So, replacing the animations in my existing structure is fine... the motions typically don't care. However, if you change the structure of the sub-state machine now you've added things (states and transitions) and that could be an issue.

    I hope that helps. If not, feel free to email tim@ootii.com and I'll try to help more.
     
  16. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    Also, some motions are much easier to swap out their animations than others.

    Idle, WalkRunX, etc are generally ptetpr straightforward. The Climb motions are fussier, and I found Jump in particular to be challenging (Running Jump is easy).
     
    Tryz likes this.
  17. SwingNinja

    SwingNinja

    Joined:
    Mar 13, 2017
    Posts:
    17
    When I said re-defined, I was talking about this section. It looks like you're trying to re-define Fall by using Jump-SM?

    Untitled-1.jpg
     
    Tryz likes this.
  18. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    The Fall motion actually inherits from Jump and thus shares the same animator sub-state machine. Most included motions correlate with SSMs on a 1:1 basis. Jump is probably not the best motion to study when learning to build or customize motions. It's one of the most complex and the code is very tightly coupled to the animations. I've tried slicing up the Movement Animset Pro jump animations to correspond with each phase/state of the default Jump motion and even after 3 or 4 attempts I still can't get it looking good.

    The "Basic" series of motions are the easiest to change animations for (as you just add new animator states with different transition conditions). Idle and WalkRunStrafe are pretty easy too. WalkRunPivot isn't too bad, but if using the start/stop and turning animations you'll need to adjust all of the transitions to match the animations you're using.

    For the record, I've also tried changing the jump animations with other third person controllers and haven't had much luck either. I think that's one case where the code needs to be written with particular animations in mind to achieve good results.
     
    Tryz and SwingNinja like this.
  19. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Ah... gotcha.

    @TeagansDad is exactly right.

    Jump is tricky because it's a "physics-based" jump. What I mean by that is the impulse, gravity, and mass determine the height and distance of the jump. Add in the fact that a platform could slide right under you mid-jump and things get tricky. So, the animation and code are tightly coupled to handle all these different things that could affect the outcome of the jump.

    As you can see by the animator, I built the jump in phases to account for the unexpected. Modifying jump can be tricky.
    If you can slice your custom jump animation to fit my phases, you'll be fine. However, it took me a while to do it and I removed the vertical root-motion a lot of jump animations have.

    Fall inherits from jump and uses similar logic because you could be falling and have a platform slide under unexpectedly.

    If you want to replace my jump with your own animation and it doesn't match my phases, I really suggest a custom motion similar to Running Jump.
     
  20. clockworkxvi

    clockworkxvi

    Joined:
    Jun 21, 2017
    Posts:
    6
    Hey again guys.

    I'm currently working on changing WalkRunStrafe while also using your lock-on feature that doesn't fix the camera position or rotation (I'm using Cinemachine to deal with camera locking) to face the combatant's lock target, but does rotate the combatant - similar to something like Devil May Cry. It seems to assume that the camera is going to be fixed behind the player, so pushing the left stick forwards will move the character forward relative to the avatar's position, not the camera's. I'd like the locomotion to be relative to the camera, instead. I can see you've handled this differently in the other locomotion motions (you've even got a variable called InputAngleFromCamera!), but I can't quite bend my head around what it is that I need to translate across.

    Will exchange words of kind praise for aid.
     
  21. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Exactly. The WRS motions are similar to The Division in that they expect the character to face the direction of the camera. I use these for aiming and shooting.

    The Walk Run Pivot motions have movement relative to the camera. So, if you were to pull back on the left stick, the character does a 180 and walks towards the camera (ie faces you).

    InputAngleFromCamera is the horizontal Angle between the input-direction and the camera-direction. So, if your camera is facing the +z axis and the left stick is pushed to the right (+x axis), the InputAngleFromCamera would be 90-degrees (or maybe -90... I'm not in front of my computer).

    InputAngleFromAvatar is the horizontal Angle between the input-direction and the character-direction. So, if your camera is facing the +z axis, the character is facing left (-x axis), and the left stick is pushed to the right (+x axis), the InputAngleFromAvatar would be 180-degrees.

    The Basic Walk Run Focus is interesting because it allows the character to move in one direction while facing another.

    I hope these help.
     
    clockworkxvi likes this.
  22. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    Hi anyone sending me messages about Bolt, Tim added networking to Motion Controller, also please contact Stanchion at Bolt. I don't mind helping, but you would get Faster better help there.

    PS: I get a ton of messages. So super busy with work in the middle of a Steam game. and others. so , and I do not plan to add to Vault since Tim added networking to it no need. Thank you.
     
    twobob and Tryz like this.
  23. bjacksondeveloper

    bjacksondeveloper

    Joined:
    Mar 7, 2018
    Posts:
    1
    Howdy All!

    So I have sword and shield set up with default motions on my player using the adventure preset, but I’m trying to achieve a certain feel with the melee.

    Currently:

    - If I walk left and click attack, I stop moving and attack.
    - If I walk left and attack, I attack left. If I then hold down right and attack without completing the attack I continue attacking left.

    I’d like to see the following behavior:

    - If I walk left and attack I’d like to kind of lunge left. Same animation, just shifting left. So rather than stopping on a dime before attacking, the attack commences as the movement winds to a stop.
    - If I attack left and start moving right, I would like my next attack to go to the right.

    This would make combat a little more cartoony and akin to the Fable series.

    Has anyone any thoughts?
     
  24. Tryz

    Tryz

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

    You can attack by moving if you setup the pack on the second animator layer. You can change that in my "Packs" view. I use Unity's layering system. So, when you set the Sword & Shield MP on the first layer it uses the full-body animations. When you set it up on the second layer it uses the upper-body animations.

    For the most part, the animations themselves determine if the character swings and steps forward or swings while standing still. Mixamo's animation mostly have you swing and stand still.

    So, the 'lunge' you talk about would really come from the animations. If you have your own attack animations (maybe Kubolds), you can replace Mixamo's free animations with your own and get the feel that you want.

    You can do this through the chaining attacks that I talk about in the documentation (page 14) or by using a custom reactor. The reactor allows you to control which attack you make.

    I hope that helps.
     
  25. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
    Some people have asked me for my discord how to interact with "ootii" and "Pixel Crushers Dialogue System". I made a little video about it and will make my script available.



    Dialogue System: https://www.assetstore.unity3d.com/en/#!/content/11672
    Motion Controller: https://www.assetstore.unity3d.com/en/#!/content/15672


    Other stuff.
    My Playmaker actions for Motion Controller: https://github.com/Salja/ootii-Playmaker-Actions

    I'm planning to do more integrations with motion controller and other assets in the near future if I can buy next month I will make (Motion Controller -> Pixel Crushers Quest Machine) (Motion Controller -> Pixel Crushers Love/Hate)

    If someone has a wish, I'm happy to do more if I have the assets
     

    Attached Files:

    rubble1, Necka_, hopeful and 2 others like this.
  26. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    You Rock! Thank you for helping the community. :)
     
    Salja likes this.
  27. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
    More stuff come ;) i glad what i can help
     
    Tryz likes this.
  28. Bjacks14

    Bjacks14

    Joined:
    Mar 16, 2015
    Posts:
    17
    Thanks Tryz for the previous help! Got everything looking sharp now :)

    Got a question about another piece of functionality though. I'm setting up warps that move the character from point to point. When the character moves through a warp though, rather than cleaning being transported to the target location, they are instead transported to the target location and "rocketed" forward as though some sort of force is acting on them.

    There is no rigidbody on the player character for force to be applied to, so I suspect this quirky behavior is being caused by Motion Controller. Any thoughts on this?

    To sum it up:

    - On warp, the player has their transform.position set.
    - Once transported to the final position, a mysterious force is propelling the player a good bit forward.
     
  29. Tryz

    Tryz

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

    I've had a rash of people pirating my assets and then asking for help. Would you please email tim@ootii.com your Unity Order ID and I'll be happy to help. Thanks.
     
    rubble1 likes this.
  30. Monsignore_Skruggz

    Monsignore_Skruggz

    Joined:
    Apr 7, 2016
    Posts:
    3
    Hey Tim,
    i have a question regarding the animations in the spell system.
    Is it possible to integrate my own casting animations (not only the spell animation) in a not too complicated way? Or is it kinda hardcoded to Mixamo? I am a 3D designer and animation designer and not even close a programmer. xD Thou I am not completly stupid and pretty sure I can get some C# or something done.

    An other question is: If i find someone, who is good a coding/network coding, are the assets compatible wiith online/multiplayer? Or at least are tweakable to run onlineor would you say, if online/multiplayer is the goal, i/we should find some to do it from scratch for us? :)

    Cheers and thanks for your awesome work! Have a nice start into the week.
     
  31. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hey @Monsignore_Skruggz :D

    Yes. There's a couple of things to do do, but it shouldn't be too hard:

    1. Ensure your animations have the animation events mine have (BeginCast, CastSpell, EndCast)
    2. In the SpellCasting-SM, add your spells like I do and have a unique Form ID in the transition conditions

    In your spell, you use the Form ID as the "Casting Style" and I'll use your animation. The other option is to replace the animations in my state machines and they will use the Form IDs that exist.

    I'd start by checking out the Spell Builder's Guide (page 6 & 7).
    http://www.ootii.com/Unity/MotionControllerPacks/SpellCasting/SpellCasting_BuildersGuide.pdf

    Then, look at my SpellCasting-SM and some of the casting states. Finally, check out a couple of my spell animations and the animation events. You should be able to do all this without any code changes.

    Yes, but (as you mention) there's work involved.

    I give a quick example of using the MC with UNet, but I know others are using Photon as well. There's a lot to networking and I'm not an expert by an stretch. So, things like mirroring arrows across computers is something that has be to figured out.

    Start with this video and it should help.
     
    boysenberry likes this.
  32. Monsignore_Skruggz

    Monsignore_Skruggz

    Joined:
    Apr 7, 2016
    Posts:
    3
    Thanks so much for the fast reply!
    Really appriciated! :)

    We were thinking about using "Ummo" for the networking part to make it a multiplayer RPG. Since we are not aiming to be the next WoW (like every third person in the "my new awesome game" section), we should be ok with the Unet backend, which should support a good amount of players. Aiming for a multiplayer rpg and not a massive multiplayer should be fine with unet, at least thats the hope.
    Combining it with assets/developers like you and ummo, is a BIG help. :)
    But we might look into Photon too. Thanks for mentioning it.
    "Best" solution might be, to go ahead with designing the world and making simple things offline like spells, inventory and stuff and looking for a good programmer to jump on board and make the networking part :)

    Thanks again for the great work
    Martin
     
    Last edited: Mar 11, 2018
    Tryz likes this.
  33. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    84
    I almost have my character working in photon with the sword and shield pack, but I'm getting two weird problems. I can post what I have up here soon, if anyone is interested.

    The first is problem respawning. I'm only able to kill a character a first time when he's brought in. On the default sword and shield pack is there something that gets disabled when the character's health reaches 0?
    After he respawns, he can take hits but never dies.

    The other question is the inventory. When I equip a weapon, it equips on all the characters.

    I think this has to do with the way the MC "finds" an input source in the scene. In my case it has to be assigned when I bring the character in, as it's coming through the network. I've experimented checking that option off, and that fixes the equip problem, but then I can't access the input.
    Is there a way to uncheck that box through code, so that the MC doesn't try to hook it up to the fist Input source?
    Or is there a way to make it so it doesn't equip the other players?
     
  34. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    Hello everyone :)

    I was wondering if anyone had completed a motion where a character pushes another object in front of him/her or even pulls an object.

    I am not quite sure how to do this so any help would be appreciated!
     
  35. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I put together a page on network multiplayer. I'm no networking guru, but I'm hoping it helps others.

    If you've worked with multiplayer, please provide any feedback to make sure I'm not steering people in the wrong direction. Thanks!

    Multiplayer Networking
     
    nomax5 and hopeful like this.
  36. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    @Tryz

    Was that a response to me? if so I was not looking for multiplayer. The current thing I'm trying to build is a humanoid pushing a wheelbarrow in front of him
     
  37. Tryz

    Tryz

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

    This has been on my list for a long time, but I just haven't gotten to it.

    I don't think it would be too hard as all we're really doing is playing an animation (the push while walking) and then moving the "connected" object as we move.

    I would suggest starting small... take the Basic Walk Run Strafe motion, copy it, change the name and description, and add it to your list. Then, in that code, add a reference to some cube you want to push/pull. Ignore the fact that the animation doesn't look right for now. Just move the cube as your character moves (in the UpdateRootMotion() function probably).

    The tricky part will be rotations. That's because the cube's rotation center will really be the character and not the cube. But, I'd worry about that second.

    Eat the elephant one bite at a time. :)
     
    Last edited: Mar 12, 2018
  38. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    hahaha... no. That was to an email I got and I just needed to do it in general. :)
     
  39. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    84
    I actually am working with multiplayer using Photon PUN.
    Your advice has actually been a lot of help Tim. Along with some of the info in the forum, the initial video, and now on the new page.

    This is a work in progress, and I'm sure someone out there can find ways to improve it, but here it goes:

    The way this works, is that I'm modifying the basic sword and shield character.

    -First Create the player prefab with the Motion Controller on it, and place it in the "Resources" folder of Photon.

    -Disable the motion controller.
    Only the Local player should have this on (network manager turns this on in my case, see below.)

    - Add a PhotonView to it. The Settings on your PhotonView should be:
    Owner – Fixed
    Observe Option – Reliable Delta Compressed
    Transform Serialization – Transform and Rotation.

    - Add a PhotonAnimatorView to it.
    Like what's documented in the new page, on this component, you want to make everything "discrete" except for the L Motion Phase Parameter (L0,L1 and L2), which should be set to "Continuous".

    - Add your custom "link" script to it, which contains functions that fire off the actions on the remote player.

    -Point the PhotonView to observe these three things: Transform (the player object itself), Animator, and your Custom Script (in my example, the "PhotonOotiiLink")

    - On the ActorCore, you want to add two "Unity Event Proxy" Reactors, one for the Damaged motion (message ID 1107) and the other for the Killed motion (message ID 1108). Activation type should be "message received". Point each to the appropriate function on your custom script (in my case PhotonSendDamage and PhotonSendDeath). Those functions are RPCs that call up the actual Damage and Death motions that only get activated on the remote.

    The Equip motions pretty much work the same as the Reactors (right?). On the Inventory's events, create an event for both "Weapon Set Equipped Event" and "Weapon Set Unequipped Event". I've pointed them both to the same function of the Link script for now (PhotonEquip), since it only cycles through one weapon set in that demo. This is a work in progress. As you'll probably notice, it's currently equipping items on all characters in the scene. I'm not quite sure how to deal with this yet, but will tackle this later.

    Finally, the "Network Manager" is just placed on any object in the scene for now, so that it brings in the player and hooks it up to the correct inputs/camera etc. A quick note on this too, in order to re-spawn the character, make sure the "Remove Body Shapes" option of the ActorCore is turned off. This works for me, but I'm just going along with what Tim has put here, so perhaps there are better ways of doing this. Finally, just make sure to also place a PhotonView on this object, and have it observe your Network Manager script like the one here.
     

    Attached Files:

    fero_gg, JUBA-C4, hopeful and 3 others like this.
  40. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    @rubble1 , you rock!

    Do you mind if I add your post and the code you shared to the new page? This way if someone has a question in a week or two I can point them there?

    Thank you very much for helping. :)
     
    rubble1, TeagansDad and boysenberry like this.
  41. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    84
    Heck yeah.
    This is kind of caveman code for now, and I'm sure a lot of you can code circles around my head. Right now, there's still the issue with it equipping both characters, but it's a work in progress. Use it as you like, and if you discover something cool, please share.
     
    Tryz likes this.
  42. lmakor

    lmakor

    Joined:
    Oct 31, 2016
    Posts:
    23
    Hi!

    I am still quite new to Unity and so my question might be dumb.

    I have Models with animations that were made with the old "Animation" component as opposed to the new Animator (mechanim) Component. Can I use these old animations with the "Third Person Motion Controller"?


    thanks!
     
  43. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    Just purchased the shooter motion pack and none of the animation files from mixamo match the meta files you included.

    Seems they have also been renamed? How do we fix this?

    I followed the instructions (https://ootiigames.com/?page_id=844) to the letter and it doesnt work. If I go in BasicShooterAttack-SM none of the animations are assigned.

    EDIT:

    So is it me or the anim files are now included in AnimationMeta.zip?
    Do I have to do anything with the Mixamo animations?

    EDIT2:

    So, after removing all ootii assets and reinstalling them Im still unable to make the shooter pack work properly. It seems the animation issue is resolved if I use the anim files in the AnimationMeta.zip but I am unable to fire a weapon. When I equip either the rifle or pistol I get the following error: NullReferenceException: Object reference not set to an instance of an object

    And there is no weapon in the player's hand although he is in a stance suggesting he should have one.

    I tried twice to set this motion pack from scratch (deleting and reinstalling all ootii assets)... no success.

    Any ideas?
     
    Last edited: Mar 14, 2018
  44. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    251
    can the character immediately stop moving when release the button?
     
  45. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
    Yeah use for movement the BasicWalkRun* motions
     
    claudius_I and Tryz like this.
  46. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    It looks like the setup of the inventory system isn't naming the equip and store motions correctly for some reason.

    If you click on the second motion layer, you'll see a list of motions like the one below. Name the Basic Item Equip and Basic Item Store motion what you see in the image and then it will work... I just tested.



    I'm not sure why it's not naming them as it should, but I'll check into that.

    I'm sorry for the hassle.

    [EDIT]
    The fix should be live now it's v0.16.
     
    Last edited: Mar 14, 2018
  47. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    As long as those animations can be imported with Unity's "Humanoid Rig", yes. You'll just have to go through the process of replacing my animations with yours.

    If your animations match mine (idle, walk forward, etc), it's just a matter of doing standard replacements in Unity's Mecanim. If your animation have other transitions, then it would be a matter of adjusting the animator states which can be more painful. At which point, you may be better off creating custom motions to match your animations.
     
  48. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    As @Salja mentioned, different motions have different properties to help with the responsiveness. For example, the Walk Run Pivot Motion has:
    1. Use Start Transition
    2. Use Stop Transition
    3. Smoothing Samples

    By unchecking the top two and reducing the Smoothing Samples to 0, the character will instantly stop.

    The Basic Walk Run X motions also use the Smoothing Sample to ramp the walking up and down. If you reduce that property to 0, the character will immediately stop as well.

    You'll see that by reducing the value to 0, the character will stop instantly. However, he also 'pops' from walking to idle because you're stopping instantly. You can play with the value to determine how smooth you want it to be.
     
    claudius_I likes this.
  49. JUBA-C4

    JUBA-C4

    Joined:
    Aug 16, 2014
    Posts:
    12
    just a heads up make sure ootii folder in the default directory i had similar issue when i moved it to sub folder ill not able to set motion packs
     
    Tryz likes this.
  50. JUBA-C4

    JUBA-C4

    Joined:
    Aug 16, 2014
    Posts:
    12
    i had an issue
    like you said you need to disable the motion in the remote player but the motion component instantiate the arrow and there is no event for but for the sword and shield there is no issue only the event will send after the animation done and i think ootii will add something like starting to equip :)

    if you have any idea for the arrow please

    we are using forge networking i recommend you to cheek on it and join there discord channel the guy who is behind bolt framework active member and very helpful with his knowledge:) i think photon not god for FPS :(
     
    Tryz and rubble1 like this.