Search Unity

Motion Controller

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

  1. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    191
    @Tryz

    Thanks for looking into to this. This will definitely help as I play around with BD more to control some of the AI.

    Are you also saying that after you undid the changes that the agent went thru the trees multiple times without getting stuck at the play area? Was the change that I made to the agent to determine if they were already at the desired location necessary?
     
  2. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    191
    @Censureret Not sure if this will help you any but Mix and Jam did a video on throwing an axe in Unity.



    I know it is not the motion controller but I think that alot of what is in that video would still apply.
     
    millej23 and Tryz like this.
  3. alexander-hunt

    alexander-hunt

    Joined:
    Jun 19, 2013
    Posts:
    8
    @Tryz

    Hello, I'd like to ask a question about compatibility with some other assets. Will this motion controller work with FinalIK and PuppetMaster? I'd like to create a procedural animation using FinalIK and play this motion from
    Sword & Shield Motion Pack's Combatant system.
     
  4. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    In the first test, all I did was re-check the "Use Nav Mesh Agent Position" property. When I ran it, it cycled through the trees and didn't seem to get stuck. I didn't spend a lot of time to see if how it worked over time. I was mostly just check to see if the character got stuck while moving.
     
  5. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    @KeithBrown @Censureret That's a great find and Keith is right. The steps are the same.

    It's just that I use the motions to control the flow of animations and be the hub for the actions taking place (like ThrowAxe() function).

    Using Archery as an example...

    To have it work with the whole system, there's a couple of things to remember:

    1. You want to go into a "Spear" state. This will let the system know you're holding a spear vs. sword vs. bow etc.

    Check out the Basic Inventory on your character. You will setup items (for the Spear) and weapon sets (for equipping the spear). On the weapon set, notice archery has a "stance" and a "form". Those tell the system you're "in attack mode" and "holding a bow". Instead, your "form" would be "holding a spear".

    We use these numbers, you'll control the animation flow.

    2. Go look at the BasicIdle-SM (animator sub-state machine) in the Archery demo. You'll see it uses the "form" to know which animation to go into when you equip the spear.

    This is true for Basic Walk Run Strafe, Basic Item Equip, etc. You add the animations to these "Basic" sub-state machines with the transitions so we know which animation to run when you're in the stance & form.



    3. The animations you'll pull from some place like Mixamo. Just like in the video.

    With this approach, you can use my Basic Idle, Basic Item Equip, Basic Item Store, Basic Walk Run Strafe, etc. motions without having to write any code.

    Throwing the spear my be a bit more tricky as that doesn't really fit with my Basic Melee Attack or Basic Ranged Attack (which uses a bow). In the Shooter Motion Pack, I created a simple "Basic Shooter Throw". That's closer, but it really does the same thing the video shows...

    It plays the animation, relies on an animation event, and calls the Launch() function that creates the grenade and launches it. It's a little more complicated because I check user input, tie it to my inventory, and check quantity. email tim@ootii.com and I'll send you that motion to look at.

    Start with the above. If that all makes sense, next step is the actual throw. Just take it one step at a time... idle, equip, store, walk, throw.
     
  6. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Yes. IK solutions like FinalIK layer on-top of standard animations. So, the MC plays the animation... like a walk. Then, FinalIK adjusts bones in real-time to handle specific bone rotation and placement.

    There used to be a Puppet Master integration video with the MC. It was done by Partel (the creator of FinalIK and Puppet Master). I'm not sure where it is.
     
  7. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    Hey guys. i have a quick question about the internal message system.

    I have the following message:

    Code (CSharp):
    1.                 CombatMessage m = CombatMessage.Allocate();
    2.                 m.ID = 9800;
    3.                 m.Recipient = other.gameObject;
    4.                 m.Sender = this.gameObject;
    5.                 m.Type = "Enable death";
    6.                
    Now sending this with the MessageDispatcher doesn't work:

    Code (CSharp):
    1.                 MessageDispatcher.SendMessage(m);
    2.  

    However if I do:

    Code (CSharp):
    1.    ActorCore otherActorcore = other.gameObject.GetComponent<ActorCore>();
    2.                     otherActorcore.SendMessage(m);
    3.                
    It works fine.

    Can you tell me why? i really want to avoid using GetComponent
     
  8. dswigger

    dswigger

    Joined:
    Aug 9, 2019
    Posts:
    12
    I spent about 2 hours trying to figure out what I was doing wrong. Thank you so much for posting this. Well...After trying it again that did not fix it. Navigate To never finishes in my scene. It seems to work in the demo scene. Guess I have to compare every single attribute.
     
    Last edited: May 31, 2020
  9. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    191
    I cannot comment on why the MessageDispatcher is not working but why do you need to get the ActorController of the other object? Can you not send the message from your current motion controller?

    I mean does the code where you are creating the combat message have a reference to the motion controller? Can you send it from there? You have assigned your recipient and your sender so it should not matter where the message is sent from? I am just asking, i have not used messages that much yet.
     
  10. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363

    I want to hit a specific object with a motion controller :) and not all
     
  11. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    Sorry for the many questions but i have one more :)

    If I have an attack animation that contains multiple hits what should I do then? should I have 1 BeginFOA and then multiple "hit" events or should I BeginFOA each time?
     
  12. Zante

    Zante

    Joined:
    Mar 29, 2008
    Posts:
    429
    Great asset! It's really fun to work with. I have a few questions regarding some animation transitions, shown in the video below:

    • The vault to idle animation seems to be a little bit jarring in my setup, any ideas? (see 00:40) - Fixed, this was due to an overly short transition in the idle SM
    • The vault to fall animation is non-existent, how could we reconfigure the state to support this? (00:14)
    • What would be the most elegant way to stop the player running into a wall and play an appropriate animation?


     
    Last edited: Jun 4, 2020
  13. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    191
    I guess I am really confused by your code. You show the ActorController calling SendMessage and passing in an IMessage. I have the latest version of ootii's assets and the only SendMessage that the ActorController has is the Unity API send message which has 4 overloads, none of which take only an IMessage or for that matter just an object.

    How do you add your listener to the MessageDispatcher? Its filter should match the Recipient property of the message.

    Code (CSharp):
    1. MessageDispatcher.AddListener("Filter", MessageHandler, true);
    2.  
    3. CombatMessage m = CombatMessage.Allocate();
    4.                 m.ID = 9800;
    5.                 m.Recipient = "Filter";
    6.                 m.Sender = this.gameObject;
    7.                 m.Type = "Enable death";
    As long as your filters match up, it should work.
     
  14. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    Thank you mate il try it out.

    I have another problem with one of my animations.

    I have this execution animation that plays on both a victim (the guy in black) and an attacker (my player)

    Now I have ligned the two up however when they get too close to another this happens:

    upload_2020-6-4_0-37-50.png

    Can anyone help me out with how I can avoid this?
     
  15. Hellwaiker

    Hellwaiker

    Joined:
    Jan 8, 2016
    Posts:
    118
    Is there a way to tell MC to temporarily stop controlling Animator's Root motion parameter?
    I'm having issues with using Unity Timeline offsets. Until I remove MC component the Animator says root motion is controlled via script and timeline offsets don't work.
    I tried both setting MC IsEnabled to false, and disabling MC component. I also tried setting AC UseTransform on, but didn't help.
     
  16. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    Unity forum notifications fail once again... I haven't gotten a single one for this thread for the past week. My apologies for responding late.

    Yes -- in fact, I posted about it on the previous page (May 22). It's due to animation clips which use root motion to displace the character (step-and-attack, get-hit-and-stumble-back, dodge, etc) when using a NavMeshAgent for pathfinding. The NMA remains in the position it was in when the motion activated, and then when the Idle or WalkRun motion re-activates, the NMA snaps to the current position of the character (which is sometimes now occupied by another character).

    I have a pending fix for this in the next update (no ETA yet -- but I'm trying to get it finished). For the time being, the easiest fix would be to create a simple MonoBehaviour that forces the NMA position to the character's current transform in its Update() method:

    Code (CSharp):
    1. mNavMeshAgent.nextPosition = mMotionController._Transform.position;
    That's not the most efficient way to do it, but it should do the trick for now.
     
    Tryz likes this.
  17. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    PuppetMaster includes an integration for Motion Controller. It still worked, the last time I tried it, although the demo scene was broken and needed to be set up again. I think the demo still references the old "Jones" Fuse character model, which is no longer included with the MC demo files.
     
    Tryz likes this.
  18. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    I believe that the design intent of BasicMeleeAttack is that there is one hit per Begin/End FOA set of events.

    When BasicMeleeAttack receives the "BeginFOA" animation event, it performs the following tasks:
    1. Set the SwordCore to active
    2. Set the AttackStyle on the SwordCore
    3. Plays the "swing sword" audio clip [in SwordCore.OnStartSwing()]
    The "EndFOA" animation event performs:
    1. Set the SwordCore to inactive
    2. Clears the AttackStyle on the SwordCore
    3. Calls SwordCore.OnEndSwing() which is blank by default
    So if all of the attacks in the animation clip are intended to be triggered by a single button press, then you would use Begin/End FOA each time.

    If the attacks are meant to be a sequence or combo where you chain together the attacks by pressing the attack button again at a certain point in the animation, then you'd need to split the animation clip into multiple clips and use a different Attack Style for each segment of the attack.
     
    Tryz likes this.
  19. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    Did you explicitly set up a listener for the message you're sending using MessageDispatcher.AddListener()?
     
    Tryz likes this.
  20. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    I'm not sure about this... maybe @Tryz can advise.

    If OnAnimatorMove() is implemented on any components, the Animator will state that Apply Root Motion is "Handled by Script." You can try setting Animator.applyRootMotion = false on one of your scripts. I'm not sure if that will override it or not, but it's worth a try.
     
  21. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    So as some of you might have seen Kubold just released a spear package that includes a spear throw :) is anyone up for the task of creating a motion set for it? it will be a paid gig :) (I'm sorry to use this forum like this but its the only place I can find developers for it :) )
     
  22. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    PM me. ;)
     
  23. BillO

    BillO

    Joined:
    Sep 26, 2010
    Posts:
    61
    What is the best way to pause the motion controller or character motion in general, while typing in a chat text field. The chat window is always open, so typing w,a,s or d can trigger movement. I couldn’t find any documentation within the user guide on the subject.
     
  24. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    MotionController.InputSource.IsEnabled determines if the motions will process input. It won't stop the current motion as it does when you "freeze" time, but it won't process any further input and the character will return to Idle.
     
    Tryz likes this.
  25. Tryz

    Tryz

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

    Like usual, @TeagansDad is right.

    The other thing you can do is create your own "sword core" or "spear core". The SwordCore inherits from WeaponCore. In WeaponCore, there's a function called OnImpact(...). When a hit occurs, that OnImpact(...) function is called. Typically this is from the TestImpact(...) or OnTriggerEnter(...) function depending if you're using true collisions or not. You could override OnImpact(...) and apply the hit multiple times or to multiple enemies.

    Once you understand the flow, you can override a couple of my functions to allow for multiple hits.

    Check out the Sword & Shield User's Guide for understanding the flow (page 7).
     
  26. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    The AC.UseTransform is the right check-box to have me stop using Animator's Root Motion.

    However @TeagansDad is right about my use of "OnAnimatorMove()". Since I include that in my code, Unity's Animator's "Apply Root Motion" check doesn't appear. You can try accessing the code as he mentioned, but I'm not sure that works.

    Use Transform should work. You may also want to create a custom component that also uses OnAnimatorMove() so that you can control things for the Timeline if needed.
     
  27. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    This can happen if your animation moves your character forward and the collision layers aren't setup right.

    For example, we want the characters to collide with each other, but we don't want them to treat each other like floors.

    So, create a layer for your characters. Then, on the characters' Actor Controller, make sure the "Collision Layers" property includes the character layer. On the characters' Actor Controller, check "Use Grounding Layers" and make sure the "Grounding Layers" property does NOT include the character layer.

    This way characters will not push through other characters, but they also won't stand on top of them.
     
  28. toshikama

    toshikama

    Joined:
    Sep 11, 2017
    Posts:
    9
    Hello.
    Thank you for the nice assets.

    Where can I see the components of Auto-Generated Code I guess.

    You used to be able to find it in the MotionController component.
    I can't find it when I changed the version of UnityEditor.

    I'm sorry to be so busy, but I'd appreciate it if you could let me know.

    MotionController Version 2.806
    UnityEditor 2018.4.23f1
     
  29. Deleted User

    Deleted User

    Guest

    Amazing (almost) plug&play solution, thank you! I have a few issues/requests of issues:

    1. It seems the motion controller+ packs don't like to be moved. However, I want to have a clean project root, all my assets are in the Plugins folder. Most assets I know either have a central space where the root path is set or they find their root path dynamically. It would be great if you could make the folders movable - for now I can change all the paths but I fear upgrading will be a maintenance nightmare. Just a couple of examples: SpellCastingPackDefinition.cs::ANIMATION_PATH, DefaultPaths::Root

    2. For some reason the component editor icons do not show up. According to the debugger the icon texture seems to be loaded properly but only an empty box is displayed. I have Unity 2019.4 with URP and it also happens with the default asset installation path

    3. The Spell Editor looks broken, see attached image

    4. Also I would love to see the Fly demo with dangling leg animations, maybe even physics based?
     

    Attached Files:

    Last edited by a moderator: Jun 12, 2020
  30. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hi @toshikama , I think I understand what you're asking for. Check the BasicMotionPackDefinitions.cs file.
     
  31. Tryz

    Tryz

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

    That's true. All my assets go under the "<project>/Assets/ootii/Assets" folder. Then, my assets have content folders for animations and such. Since I automatically setup sub-state machines, I have to know where the source animations are. You can move them after setting up your character, but if you try to setup a pack and the animations aren't where I expect them than I can't setup the state machine.

    Unity should use the reference to my images. So, I would think you could move those. However, if the Unity meta files were changed, than Unity loses references and I can't load the GUI images.

    Based on the image you sent, it looks like Unity can't find the background images I'm trying to load. I haven't played with URP. I wouldn't think it would effect the Unity Editor, but I'll try loading it an see.

    It's not something I'll have time for, but I would think that's pretty simple. You're just talking about loading animations or FK/IK that layers on the animation.
     
    Deleted User likes this.
  32. toshikama

    toshikama

    Joined:
    Sep 11, 2017
    Posts:
    9
    Thank you!

    What I'm looking for is a motion type in the MotionController that appears in It's a blue button that should have been there.
    It is as shown in the attached image.
    I can't see it.

    But I was able to press it, so it's not a problem.
    Thank you!
     

    Attached Files:

    Tryz likes this.
  33. Hellwaiker

    Hellwaiker

    Joined:
    Jan 8, 2016
    Posts:
    118
    Hello, not sure if this is connected to MC, but for some players unity just crashes when the game launches and for them the player log has this:
    Not sure if this is in any way originated in MC, but just wanted to ask if anything about this error maybe gives clues how it could crash?

    The crash happens when a game scene is loaded, and bunch of characters get the AC/MC compoments enabled. Weird thing is it happens only to some players, but it happens consistently for them.
    Code (CSharp):
    1. ========== OUTPUTTING STACK TRACE ==================
    2.  
    3. 0x00007FF9D8DEC37C (UnityPlayer) UnityMain
    4. 0x00007FF9D8D9165F (UnityPlayer) UnityMain
    5. 0x00007FF9D856C271 (UnityPlayer) UnityMain
    6. 0x00007FF9D8573FFD (UnityPlayer) UnityMain
    7. 0x00007FF9D856AFD7 (UnityPlayer) UnityMain
    8. 0x00007FF9D8491A76 (UnityPlayer) UnityMain
    9. 0x00007FF9D849188A (UnityPlayer) UnityMain
    10. 0x00007FF9D857E4D9 (UnityPlayer) UnityMain
    11. 0x00007FF9D8650093 (UnityPlayer) UnityMain
    12. 0x000001CEA34B9909 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.GameObject:Internal_AddComponentWithType (UnityEngine.GameObject,System.Type)
    13. 0x000001CEA34B9843 (Mono JIT Code) UnityEngine.GameObject:AddComponent (System.Type)
    14. 0x000001CEA34B977B (Mono JIT Code) UnityEngine.GameObject:AddComponent<T_REF> ()
    15. 0x000001CCE2015B23 (Mono JIT Code) com.ootii.Actors.BodyCapsule:CreateUnityColliders ()
    16. 0x000001CCE2014D38 (Mono JIT Code) com.ootii.Actors.BodyShape:set_UseUnityColliders (bool)
    17. 0x000001CF660CA21C (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___byte (object,intptr,intptr,intptr)
    18. 0x00007FF9E0D7CBA0 (mono-2.0-bdwgc) mono_get_runtime_build_info
    19. 0x00007FF9E0D02112 (mono-2.0-bdwgc) mono_perfcounters_init
    20. 0x00007FF9E0D0B2E2 (mono-2.0-bdwgc) mono_runtime_invoke_array
    21. 0x00007FF9E0D0BA79 (mono-2.0-bdwgc) mono_runtime_set_main_args
    22. 0x00007FF9E0D0B276 (mono-2.0-bdwgc) mono_runtime_invoke_array
    23. 0x00007FF9E0CB02A4 (mono-2.0-bdwgc) mono_lookup_internal_call
    24. 0x000001CEA16F6240 (Mono JIT Code) (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
    25. 0x000001CEA16F586B (Mono JIT Code) System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
    26. 0x000001CF660C96A3 (Mono JIT Code) System.Reflection.MonoProperty:SetValue (object,object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
    27. 0x000001CF660C954D (Mono JIT Code) System.Reflection.PropertyInfo:SetValue (object,object,object[])
    28. 0x000001CCE2013E14 (Mono JIT Code) com.ootii.Actors.BodyShape:Deserialize (string)
    29. 0x000001CCE2013738 (Mono JIT Code) com.ootii.Actors.ActorController:DeserializeBodyShapes ()
    30. 0x000001CCE20132F3 (Mono JIT Code) com.ootii.Actors.ActorController:CreateBodyShapes ()
    31. 0x000001CCE2012143 (Mono JIT Code) com.ootii.Actors.ActorController:Start ()
    32. 0x000001CEAF1AA1E0 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
    33. 0x00007FF9E0D7CBA0 (mono-2.0-bdwgc) mono_get_runtime_build_info
    34. 0x00007FF9E0D02112 (mono-2.0-bdwgc) mono_perfcounters_init
    35. 0x00007FF9E0D0B10F (mono-2.0-bdwgc) mono_runtime_invoke
     
  34. Deleted User

    Deleted User

    Guest

    Hmm it's not related to URP. Just tried a fresh 2019.3 project with builtin renderer and fresh MC import without moving anything. Spell Editor still looks broken like in the screenshot, component editor icons are not loaded.

    One more issue: The demo_SpellCasting seems broken. Whichever spell I use, the character always gets stuck in the same pose after a very short start-cast animation and moves half way in the ground. The animator then endlessly repeats the same animation without the character actually moving. The only thing I can do then is turning. See attached screenshot. Input entries, motion pack incl. mixamo animations and layers are setup.
     

    Attached Files:

  35. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I just tested in 2019.4.0f1 and don't see the issue:



    However, someone else emailed me and reported the same thing. The only difference we could tell is that they were using a Mac. Unfortunately, that's not something I have access to test with. Are you using a Mac by chance?

    Could you zip up your project and email it to tim@ootii.com? Maybe there's another setting I could look at.

    That pose is Unity's "I can't find the animation" pose. That crouch-and-in-the-ground basically means the sub-state machine is there, but there's not animation.

    If you click in that sub-state node from your picture, I'll bet there is no animation there.

    Across all my motion packs, the reason is always one of these:
    1. The animations aren't in the right folder
    2. The animation meta files aren't the ones from my zip
    3. Unity needs to be closed and re-opened

    Can you double check the sub-state and try #3?
     
  36. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Unfortunately, I'm not sure. It looks like all those things completed successfully and most of them are part of Unity's run-time. If you can find an error log there maybe something more to look at.

    What if you get it down to one character that does this consistently. Is there something different about that character's setup?
     
  37. Hellwaiker

    Hellwaiker

    Joined:
    Jan 8, 2016
    Posts:
    118
    Unfortunately, I can't recreate this on my computer even though I ran the game a couple of hundred times. This happens to a few users but consistently to them.

    I'm suspecting this might be Unity Engine problem because crash reports say:
    UnityPlayer.dll caused an Access Violation (0xc0000005)
    Read from location 000001F640904018 caused an access violation.
    ERROR: SymGetSymFromAddr64, GetLastError: 'Es wurde versucht, auf eine unzulässige Adresse zuzugreifen.' (Address: 00007FFFABA39D8A) ("An attempt was made to access an illegal address.")

    I'll try contacting Unity about this.
     
    Tryz likes this.
  38. Deleted User

    Deleted User

    Guest

    @Tryz Thanks, I found out, what the issue with the component editor icons and the spell editor is: I have a 4K monitor and need a Windows dpi scale of 125%. This offsets the position of the MC icons/textures in Unity so I cannot seem them anymore. I had a similar issue with the Editor Console Pro until FlyingWorm fixed it - it would be great if you could make the editors dpi-aware.

    On Win10 you can find the setting here: Settings -> Display settings -> Scale and layout -> Change the size of text, apps, and other items. Please note that you can also have multiple monitors with different dpi scale settings. My second monitor is set to 100% and everything is displayed correctly when I move the editor window there.

    Regarding the spellcasting demo scene: thanks, it was indeed a meta file issue, it is working now.
     
  39. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    I'm actually doing a revision pass over all of the custom Editors right now, making everything consistent and simplifying where possible.

    If you know what the solution is (or where to start looking for it), it would make my job a lot faster and easier. I did a very quick search but haven't found an answer yet.
     
  40. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @Dark_Swordsman - after a bit more looking into it, it honestly looks like it would be a lot of tedious and error-prone work to fix all of the current immediate mode Editor tools to work on higher-DPI displays. I would much rather invest the time and energy into rewriting all of the custom Editor tools using UIElements.

    The problem you're experiencing with the custom inspectors is just cosmetic, right? (The ootii icon and background images aren't displaying correctly).

    The Spell Editor is non-functional when using a high DPI display, so I will spend a bit of time with it to see if I can fix the positioning issues. If it looks like it will be too much work, then I'll make that my first priority for conversion to UIElements.
     
  41. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I'm wondering if that's really it. I don't have a 4k monitor here, but I can change the scale settings like you said and everything still looks fine on my Windows machine.



    The other thing that's odd is that since we're working in the Unity environment, I would have expected them to handle this at the engine level.

    It might have something to do with your multiple displays or 4k display. I'll keep looking, but I'm not 100% sure there's something for us to "fix". I'll keep looking at it too.

    @TeagansDad may be seeing something that I don't.
     
  42. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @Tryz I am able to replicate what he's seeing. If I set the Display scaling above 100% then my custom inspectors don't have the ootii icon, the "box" GUIStyles don't have the loaded background image, and the Spell Editor is totally messed up

    You're on to something with the multiple displays though. I've run all this on my 15" laptop just fine at 125% scaling. And I've used it on dual monitors on my work PC with no problems -- both set to 100% scaling.

    But I looked at it today on my current setup, which is my laptop with an external monitor. When both were at 100% scaling, there were no problems. I wasn't thinking about dual monitors being an issue, so when I set my main display to 125% I saw the same issues as reported. I did not think to try setting my laptop screen to 125% as well -- maybe it has to do with running multiple screens at different DPI or scaling settings. I'm away from the computer, so I can't try it right now.

    At any rate, trying to address this with the immediate mode Editor API sounds like a nightmare. Maybe a UIElements GUI would avoid the issue
     
    Tryz likes this.
  43. Zante

    Zante

    Joined:
    Mar 29, 2008
    Posts:
    429
    Does the Shooter Motion Pack support pistol-based animations?

    I was looking through the mixamo pro-rifle pack and couldn't see anything by way of a pistol handling stance in the reel.
     
  44. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hi @Zante , it does support pistols. In the animations to download from Mixamo, I point out some pistol based ones as well.

    At 0:54 in the video, you can see that in action.
     
    Zante likes this.
  45. Deleted User

    Deleted User

    Guest

    @Tryz: There is also an engine setting that uses the desktop setting by default, maybe yours is explicitly set to 100%: Edit -> Preferences -> UI Scaling

    I tried with just one monitor and same issue for any scale value other than 100%. Not sure how to fix it, probably by reading the dpi and modifying image offset/scale values by it, I also would have thought that this is handled by the Engine. However, all my other assets with complex editors such as DoozyUI and Amplify Shader Editor work fine, Editor Console Pro had the same issue but it was fixed.
     
    Tryz likes this.
  46. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    191
    @Tryz @TeagansDad It could possibly also depend on which monitor is set to your main monitor if the resolution and scaling are different in a multi monitor solution and Unity is not running on the main monitor.
     
  47. pedropla

    pedropla

    Joined:
    Apr 9, 2018
    Posts:
    21
    @Dark_Swordsman, @Tryz, @TeagansDad I can confirm the background image issues are related to DPI and on both Mac and PC. When the DPI is above 100% the background images don't show up.

    The hack I use for the SpellEditor when I can't change the DPI (Macbook Pro with Retina), is to just change the font color in the code to black so that it contrasts with the white node boxes.

    Edit: Even with just a single screen with DPI set above 100% it triggers the problem. This happens on both Windows 10 and MacOS. I have a windows machine with a 4k screen and at 125% dpi (the default) it causes the error. My Macbook Pro with Retina has the error unless I plug it into an external non-retina display which has 100% DPI.
     
    Last edited: Jun 23, 2020
  48. knobby67

    knobby67

    Joined:
    Aug 30, 2015
    Posts:
    389
    Hi
    Just been looking at this product, which seems what I need. Read the manuals, played the webgl demo and watched some videos but have a couple of questions for users that I couldn't find the answers to.
    1. On climbing, the standard kind up a wall, can I turn a corner? Say I'm climbing a square tower can I circle it?
    2. If running up a slope and the angle gets to steep can I auto fall into climbing?
    Thanks for the advise.
     
  49. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @Dark_Swordsman, @pedropla, @Tryz - This isn't a proper "fix" but there is a workaround for the high-DPI editor scaling issues.

    Under Edit -> Preferences -> UI Scaling you can uncheck Use default desktop scaling (which is enabled by default) and then set the scaling value to 100% (this will require the editor to be restarted). This is for Unity 2019.3 and later.

    upload_2020-6-23_10-21-44.png

    I'll keep looking into an actual fix.
     
    Tryz likes this.
  50. greatowq01

    greatowq01

    Joined:
    Dec 16, 2018
    Posts:
    37
    Hi, guys. I encounter a problem when i try to create a custom SpellAction. The test Code like this:

    Code (CSharp):
    1.  
    2. [CreateAssetMenu(menuName ="ScriptableObject/NewTest01")]
    3. public class NewTest : ScriptableObject
    4. {
    5.     public int length;
    6. #if UNITY_EDITOR
    7.     public bool OnInspectorGUI()
    8.     {
    9.         bool lDirty = false;
    10.         if (EditorHelper.IntField("Length", "Length", length))
    11.         {
    12.             lDirty = true;
    13.             length = EditorHelper.FieldIntValue;
    14.         }
    15.         return lDirty;
    16.     }
    17. #endif
    Code (CSharp):
    1. #if UNITY_EDITOR
    2. using UnityEditor;
    3. #endif
    4.  
    5. public class ActorEffect_Test01 : SpellAction
    6. {
    7.     public string Effect_Name = "";
    8.     public NewTest _test;
    9.     public NewTest test
    10.     {
    11.         get { return _test; }
    12.         set { _test = value; }
    13.     }
    14.  
    15.     public override void Awake()
    16.     {
    17.         base.Awake();
    18.         _DeactivationIndex = EnumSpellActionDeactivation.IMMEDIATELY;
    19.     }
    20.  
    21.     #region Editor
    22. #if UNITY_EDITOR
    23.     int i = 0;
    24.     public override bool OnInspectorGUI(Object rTarget)
    25.     {
    26.         bool lDirty = base.OnInspectorGUI(rTarget);
    27.         if (EditorHelper.TextField("EffectName", "EffectName", Effect_Name))
    28.         {
    29.             lDirty = true;
    30.             Effect_Name = EditorHelper.FieldStringValue;
    31.         }
    32.         if (test==null)
    33.         {
    34.             i++;
    35.             Debug.Log("test==null,No"+i);
    36.             test = new NewTest();
    37.         }
    38.         bool lDirty02 = test.OnInspectorGUI();
    39.         if (lDirty ||lDirty02)
    40.         {
    41.             Debug.Log("test.length="+test.length);
    42.             lDirty = true;
    43.         }
    44.         return lDirty;
    45.     }
    46. #endif
    47. #endregion
    48. }
    49.  
    After all above,I add a Test01 Node in the SpellEditor , set the "Length" to 3,and then click "Save". As it shows below:
    upload_2020-6-27_11-29-36.png
    However, when i close Unity and reopen it, the "Length" return to 0.It can see that the "Save " function failed to save the custom data--NewTest.length.

    How can I fix this issue?