Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

►► IK Avatar Driver

Discussion in 'Assets and Asset Store' started by Stephen_O, Jan 18, 2020.

  1. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,353
    Don't let your cars drive empty!

    IK Avatar Driver is an arcade style car controller with a procedurally animated inverse kinematics avatar driver, you can customize it with your own car and humanoid-character models. The avatar is modular and can be used with Simple Traffic System, Edy’s Vehicle Physics 2, NWH Vehicle Physics and Realistic Car Controller.

    Asset Store




    Key Car Controller Features:
    • Mobile ready prefab (drag & drop)
    • Look-back camera
    • Driver-helmet camera
    • Automatic or manual transmission
    • Left & right side driver prefabs
    • Rear & side view mirrors
    • Nitro
    • Quick prefab configuration for new car models

    Key Avatar Features:
    • Use any Humanoid Avatar model
    • Driver works on left or right side of car
    • Procedural animations include: steer, look in steer direction, shift, apply foot brake, gas and shift pedal
    • Works with Simple Traffic System
    • Works with Edy’s Vehicle Physics
    • Works with NWH Vehicle Physics
    • Works with Realistic Car Controller

    Replacing the Avatar Driver Model


    IK Avatar Driver with Edy's Vehicle Physics


    IK Avatar Driver with NWH Vehicle Physics


    IK Avatar Driver with Realistic Car Controller
     
    Last edited: Jun 29, 2020
    Willbkool_FPCS likes this.
  2. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,353
    IK Avatar Driver is now available.
     
  3. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,353
    Version 1.0.1 submitted.

    • Added support package to use the Avatar Driver prefab with AI cars from Simple Traffic System.

     
  4. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,353
    Version 1.0.1 is now available.
     
    vorokoi likes this.
  5. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    214
    What's the compatibility like with NWH Vehicle Physics 2?
     
  6. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,353
    IK Driver will likely only work with NWH 1, I just reached out to the NWH dev about integration with NWH 2.
     
  7. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    214
    Awesome, thanks.
     
    Stephen_O likes this.
  8. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,353
    I've spoken with NWH developer and have received access to the new version but have been told NWH 2 version 1.0 is coming in the next few days. It will take me a bit of time to test, develop, document and update my package for the integration of the new asset. An update should be available to support NWH 2 within the next 2 weeks, I'll post details here when it's submitted to the asset store.
     
    Willbkool_FPCS likes this.
  9. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    214
    thanks.
     
  10. Fibonaccov

    Fibonaccov

    Joined:
    May 5, 2020
    Posts:
    25
    Hi,

    What is the number of polys or tris for that avatar model? Looks neat. Thanks

    I am mostly interested for Mobile.
     
  11. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,353
    Hello,

    Here are the stats, it's not the best for mobile, but you can replace the driver model with your own models too.

    Body 7927 verts, 14159 tris
    Helmet 2766 verts, 2866 tris
     
    Fibonaccov likes this.
  12. Fibonaccov

    Fibonaccov

    Joined:
    May 5, 2020
    Posts:
    25
    Thank you! It is not that bad and I can probably optimize it a bit - Best.
     
    Stephen_O likes this.
  13. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    214
    How the update coming along?
     
    Stephen_O likes this.
  14. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,353
    I've been pretty busy lately, but adding support for the new NWH package is still at the top of my priority list.
     
  15. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,353
    Version 1.0.2 will be submitted today, this will update Avatar support to be compatible with NWH Vehicle Physics 2. Here's the updated tutorial:

     
    nobluff67 likes this.
  16. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,353
    Version 1.0.2 submitted.

    • Updated Avatar support to be compatible with NWH Vehicle Physics 2.
     
    Willbkool_FPCS and nobluff67 like this.
  17. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    214
    Is this error due to the car being automatic? Does this, or can it be made to work with automatic shift? Error is on play.

    NullReferenceException: Object reference not set to an instance of an object
    TurnTheGameOn.IKAvatarDriver.AvatarDriver_NWHReference.get_nwh_gear () (at Assets/TurnTheGameOn/IKAvatarDriver/Scripts/AvatarDriver_NWHReference.cs:35)
    TurnTheGameOn.IKAvatarDriver.AvatarDriver.OnGetInput_NWH () (at Assets/TurnTheGameOn/IKAvatarDriver/Scripts/AvatarDriver.cs:138)
    TurnTheGameOn.IKAvatarDriver.AvatarDriver_NWHReference.Update () (at Assets/TurnTheGameOn/IKAvatarDriver/Scripts/AvatarDriver_NWHReference.cs:45)
     
  18. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,353

    In the tutorial I had a fresh install of both assets without any changes to the NWH prefab, the car was automatic default so I don't think that's the cause.

    Can you provide me with steps you've taken so I can reproduce the errors, maybe you used a different prefab that has different components?

    My NWH reference script is reading the prefab's DigitalGauge component for gear text, perhaps this is not available on all prefabs and needs to be adjusted.
     
  19. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    214
    Works fine with sports car as per the video. The error is with the suv, which is no longer part of the new version of NWP2. It must be with the suv setup so will debug. I will also test the other vehicles.
     
    Stephen_O likes this.
  20. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    214
    Works well with Niva vehicle, just needs some adjustments to steering wheel.
     
  21. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,353
    The integration is only supporting NWH2 at this point, and will not work with NWH1; if there's a specific reference type that you might need exposed let me know and I can add it.
     
    nobluff67 likes this.
  22. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    214
    Yip, it was part of the NWH2, the developer removed it on a release update. I will debug and see what is different between the two vehicles.
     
    Stephen_O likes this.
  23. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,353
    New tutorial for customizing the avatar driver model.

     
    Willbkool_FPCS likes this.
  24. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    962
    Is there a playable demo showing this system in action?
     
  25. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,353
    You can try the Arcade Racer Demo from Arcade Racer: Racing Game Development Kit, it uses the same system.

    This demo is for the standalone game template, IK Avatar Driver only includes the car controller and IK avatar.

    Thanks for the question, I'll make a dedicated demo for this asset.
     
  26. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    214
    Getting this error on NWH2

    Assets\TurnTheGameOn\IKAvatarDriver\Scripts\AvatarDriver_NWHReference.cs(21,57): error CS1061: 'Input' does not contain a definition for 'Horizontal' and no accessible extension method 'Horizontal' accepting a first argument of type 'Input' could be found (are you missing a using directive or an assembly reference?)
     
    Stephen_O likes this.
  27. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,353
    Thanks for letting me know. It looks like a variable name was changed in NWH. I'll make sure to update the support script and submit a fix shortly. I'll post here when it's available.

    You can do this on your own if you prefer not to wait, edit the AvatarDriver_NWHReference script, change line 21 from:
    Code (CSharp):
    1. return vehicleControllerReference.input.Horizontal;
    Code (CSharp):
    1. return vehicleControllerReference.input.Steering;
     
    Willbkool_FPCS likes this.
  28. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    214
    Thanks. I actually just got a reply from developer on discord, he also mentions the vertical has changed, not sure if this effects your asset. The actual vertical variable still seems to be in his code so it doesn't throw error on ik avatar.

    It is input.Steering and input.Throttle instead of Vert/Horizontal now. Needed to make this change when I split the Throttle and Brake into separate axes to enable simultaneous application of both.
     
    Stephen_O likes this.
  29. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    214
    FYI, the issue with the gear error in the post above (a while ago), I found out the issue. In order to solve the issue, you need to copy the "Gauges" gameobjects from one of the working demo cars (I used sports car)
     
    Stephen_O likes this.
  30. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,353
    vertical is used for foot animations, they were working as expected when I tested. But I might as well change it to throttle too.
     
    nobluff67 likes this.
  31. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,353
    I'll likely spend some time on this asset for updates soon, when I do, I'll see if I can find a better variable to read, which would reduce the need for gear text.
     
  32. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,353
    Version 1.0.5 submitted.

    • Updated AvatarDriver_NWHReference variable from Horizontal to Steering.
    • Updated AvatarDriver_NWHReference variable from Vertical to Throttle.
    • Updated AvatarDriver_NWHReference gear variable from digitalGauge to powertrain.transmission.Gear; resolves issues where some cars do not have a digital gauge to read.
     
    nobluff67 likes this.
  33. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,353
    Version 1.0.5 is now available.
     
    nobluff67 likes this.
unityunity