Search Unity

[RELEASED] Sportbike PRO kit (motorcycle physics)

Discussion in 'Assets and Asset Store' started by bcman, Sep 13, 2015.

  1. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Hello, eddyjohnson3.

    1. My apologies but it's still doesn't work well at 5.3 :( It can be fixed but now results are ugly.
    2. Yes, everything is in manual. Setup of character for mecanim is extremely easy but ideology of mecanim itself is hard as hell :) At least for me :)
    3. I bet you've tried chopper and motard bike. Choper can't perform stoppie because of long base, as for motard, i've made weak front brakes as because those guys in motocross hates strong front brakes :)
    Try sportbike instead. Just accelerate to 30-200km/h and press "S" or down arrow. You'll get stoppie for sure.
    Do not use ESP("Z" key) it's prevents stoppie.
     
    Last edited: Feb 20, 2016
  2. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Hello, hunterloftis.

    Yes, it' uses standard WheelCollider. You may change everything like stiffness and other parameters.
    But I must warn you it's not compatible with 5.3 yet. My fault. I'm working on that.
    Now it' works in 5.0-5.1. Can't say for sure about 5.2.
     
  3. eddyjohnson3

    eddyjohnson3

    Joined:
    Jul 27, 2012
    Posts:
    49
    Thanks for the reply.

    You are correct, I can achieve wheelie and stoppie with the sport bike, although stoppie is pretty hard to control, which I guess makes sense if you do not have a real brake lever but just a button. One thing I noticed that shifting the rider weight using F or V actually prevents acheiving a wheelie. Shouldn't it be that shifting weight back should actually make it easier to get front wheel off the ground?

    Still looks like a great package, I will be checking the progress of updates and hopefully make a purchase when I have the time... ;)
     
  4. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Great news ! Now it working with Unity 5.3 !

    The update will be uploaded to AssetStore as soon as possible.
     
  5. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Hi there, eddyjohnson3.

    Oh, that's true. My fault ;( For now I have no idea why it's happens but when I finish mobile controls, I'll fix it ASAP.

    P.S. Thanks for bug report :)
     
  6. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Now with full support Unity5.3 ! No "lazy steering" anymore.

    Mobile version is coming soon :)
     
    Jawadov and hakankaraduman like this.
  7. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Hi everyone !

    Just want to warn you :)
    I've rewrite all controls logic for mobile version 1.5. It's waiting for Unity's approve.
    So, if you have own code in any scripts DO NOT install 1.5 to your project.
    1.5 is cool, is mobile but not compatible with old controls ideology.

    I hope you will love new control methods :)
     
    hakankaraduman likes this.
  8. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    354
    Is package still javascript?
     
  9. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    The old code(bike and pilot's) is JS.
    New code(keyboard and mobile controllers) is in c#.
    Someday I'll rewrite in C# everything... someday.
     
    hopeful likes this.
  10. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    So, mobile version 1.5 is available.

    Now I'm focus on bugs fixes.
     
  11. Timaman

    Timaman

    Joined:
    May 15, 2013
    Posts:
    6
    Hey!

    I'm really considering acquiring this for my project. Just a couple of queries concerning it.

    When the suspension moves, is it possible to have to springs actually compress?

    Movement seems to be very sluggish (both when turning and when becoming straight again), and I'm looking for controls that feel much tighter (my end goal is motorcycles that handle like they do in GTA V). Is it possible to do this with your script?

    I understand this is a more realistic script, and I want something more arcade styled, but other scripts on the asset store simply lack a lot of features this one has.

    Thanks!
     
  12. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Hello, Timaman.

    The spring is standard Unity's(PhysiX) suspension controller. So, it's working like any other suspension systems around the world.
    Or you talking about real geometry(mesh) ? Yes, it's possible by animation or by script(change Y scale) but you should to make skinned mesh, write code by yourself.

    As for sluggish leaning - it's depended on bike's setup and bike "geometry" - length of bike, center of mass, angle of front forge and so on. You may compare the chopper and sportsbike and you will see huge difference in speed of cornering.
    So, you can make fast steering as you wish.

    Thank you.
     
  13. Timaman

    Timaman

    Joined:
    May 15, 2013
    Posts:
    6
    Hi! Thanks for your prompt reply.

    I bought the kit and it's great, just one more question.

    I've increased the steering angle so the bike steers quicker, but a side effect is that the bike leans a lot more than it should, especially at low speeds. How can I reduce lean without reducing the steering angle? Thanks
     
    Last edited: May 2, 2016
  14. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Hey, Timaman.

    Sorry, for long answer.
    First of all, you need to play with center of mass initial position. I believe it will fix everything.
     
  15. Timaman

    Timaman

    Joined:
    May 15, 2013
    Posts:
    6
    Hi

    I've tried this, but moving the CoM up or down just makes the bike lean faster or slower, and doesn't limit the actual angle of lean, which is what I'm trying to do. Thanks
     
  16. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Okay.
    First of all, can you make video of unpleasant behavior of bike ?
    May you send me a project ?

    I want to understand is that a real problem of physics.
    Or visuals just "seems" not good and "fake" solution is better way.
     
  17. Timaman

    Timaman

    Joined:
    May 15, 2013
    Posts:
    6
    Open up the sportbike project and set the wheelbar restrict curve like in this picture: https://i.gyazo.com/0a90b17bc0d7d6df8823d23418c13d4c.png

    You'll see at low speeds there's 60-70 degrees of lean, and at high speeds at least 45. I want half of this, but I cannot figure out what it is that actually makes the bike lean. I've been through all the code and I'm 90% sure its caused by moving the CoM, but I cannot understand what section of code actually does that.
     
  18. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    I see.
    You like turn radius but dislike leaning angle.
    Okay, give few days to think about workaround.


    Bikes turning by leaning, so the bike geometry, base length and forge angle determines turn radius.
    You may try motard bike and there is much less turn radius because of less bike base.
    Anyway I'll find solution for you.
     
  19. Timaman

    Timaman

    Joined:
    May 15, 2013
    Posts:
    6
    Okay, thankyou. I've yet to implement my own bike geometry, but it won't be much different from the standard bike, so I was hoping to work out these kinks first. Thanks again :)
     
  20. khos85

    khos85

    Joined:
    Jul 21, 2013
    Posts:
    541
    I would like to ask for some guidance. I'm making a trial bike game, I came close to how I wanted with my scripts etc but I am looking for alternatives), I purchased your asset to try adapt it for my use but I am not sure where to start.
    What I aiming to be able to do is:
    -Rock front wheel to back wheel to turn bike around.
    -Lift the back wheel up (like endo) but swing frame around to do a 180 turn.
    -Wheelie bike but when bike is stationary, front wheel must stay in air, in trials this is a backwheel hop move.
    -simulate pedal gap.
    -side hop.
    -track stand.
    -ETC :)

    I would not expect you to modify scripts (unless you would be willing that would be most awesome) etc but would appreciate some advice on where you think I could start, eg I use my own scripts, attached to parent object, to add force / torque to whole body if eg I want to keep that wheel off the ground (eg used for back wheel hop?) Or for a static wheelie would I need to rotate the transform to eg 30 degrees?

    Thanks for any advise you could provide.
     
  21. khos85

    khos85

    Joined:
    Jul 21, 2013
    Posts:
    541
    Hi Bcman, I would like to ask if you managed to make any progress or consider a bicycle version of your asset?
     
  22. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Hi there, khos85.

    Oh, yes :)

    Give me couple of days to show video.
    Now I got rider, some tricks like backflip360, bunny hop and other stuff.
    The only problem I still not finished it is absolutely broken behavior with no rear suppression with MTB and BMX :(
     
  23. khos85

    khos85

    Joined:
    Jul 21, 2013
    Posts:
    541
    What! This sounds very nice indeed. My bike does not have any suspension, so sounds like just what I'm looking for! Can I be a early beta tester :) How do you implement eg bunny hop, with physics?
     
  24. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Hi, khos85.
    Yes, it's all about physics - backflips, bunnys and other manuals :)



    Here is WiP version of current project.
    But, there is not just bicycle "preset" for SPK.
    Bicycle behavior is very different from motorcycle, so it's new module.
    I've called it "Bicycle Pro Kit" :)
     
  25. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,490
    Oh wow, looks good so far. Will you be selling this as a separate asset? How soon do you expect to be able to release this?
    I would be interested in if more static moves can be achieved too, eg endo or backwheel hop, I suspect yet.
     
  26. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Hi there.

    I think it will be new asset. But for you, real enthusiast, I promise it will be free :)
    As for release date - still have no idea. It's not so stable as motorcycle after some jumps, so need time to make it really similar as real life.

    Let's say couple of months.
     
  27. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,490
    That would be awesome! My game I am not interested in Jumps at all.. you mention months :( , nooooooo that is too long :) just kidding, well I hope you can make it available sooner :)
     
  28. hottabych

    hottabych

    Joined:
    Apr 18, 2015
    Posts:
    107
    I highly appreciated this package. But please, translate your bike script to C# !
    Our game project is entirely in C#, which isn't interoperable with JS.
     
  29. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    354
    In case you didn't know, you can put the js package, sportbike pro in this case, under a folder named "Plugins" and Unity will compile the js script first so you can access it from c# code.

    But I second your request. At the first version of this package, I translated it from javascript to c# to feel more comfortable with it. It took less then a day but the bad thing is when the package is updated, you gotta start over.
     
    hopeful likes this.
  30. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,490
    Not trying to sound rude but I feel like this is maybe your own fault for using C# only, why not just use JS?
    Nothing wrong with JS.. IMO.. Can't you just mix the two together? I do it and works fine.
     
  31. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Hi there, hottabych.

    First of all, let me reassure you - JS and C# works fine together.
    You can easily take any variable or method from C# and even vise versa.
    All you need to call C# variables or methods from JS is put C# scripts to folder Plugins or Resources.
    Really easy. It's showed in last version of this asset when I used it for mobile controls.
     
  32. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    397
    Not sure why half the code is in C# and the other half is in javascript but it makes this a pain to work with when I'm hooking it up to the rest of my game. Do you have a full C# version?
     
    hopeful likes this.
  33. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Hello, wightwhale.
    There is no full C# version for all scripts.
    As for me, it's not a problem at all.
    But how can I solve your pain with C# and JS linking ?
     
  34. Deleted User

    Deleted User

    Guest

    That is the ONLY reason I have not purchased...FYI.

    The REAL question, why NOT spend the time to convert ALL?

    If you are not AWARE of strongly typed languages, your in the WRONG business.

    p-
     
  35. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    397
    I have converted it to C# i'll send it to bcman soon.
     
    hopeful likes this.
  36. maxtwoseven

    maxtwoseven

    Joined:
    Dec 13, 2016
    Posts:
    2
    Hi, bcman. Bought your plugin to work on a project and it's really awesome. Nice work!

    I'm trying to experiment with a VR headset though and I'm having trouble figuring out how to make the VR camera follow the bike like the original Main Camera did. Do you know what I might need to do to make that happen?

    I'm new to Unity, so this is probably something pretty easy but I'm just wondering if the cam switcher script might be interfering in some way. I've tried attaching the SteamVR script and making the Head GameObject the target.
     
  37. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Greetings, maxtwoseven.
    Honestly I'm not experienced in VR cameras as well. But I wrote 3D camera for my 3D TV and it works fine.
    So, write to my e-mail(smokerr@mail.ru) and we'll try to find good solution for your case.
     
  38. tristanatbossa

    tristanatbossa

    Joined:
    Dec 14, 2016
    Posts:
    1
    I'm considering buying this plugin but I would need to be able to simulate crashes and stunts using the motocross bike (want to make a FMX style game). I'm happy to do the work to simulate those things I just want to know if its possible with your package without hacking it too much?
     
  39. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Hi there, tristanatbossa.

    My asset provides physics. And crashes as aftermath of collisions. Sometimes it's looking good. Sometimes not :( It depends on Unity and nVidia physics engine.
    You can improve it by yourself. I believe it's possible to make something really good like BeamNG on Untity. But face it - it's on your side. You and only you should imagine and code it then. Sometimes coding is fun. Sometimes not :(

    To be honest - good and beauty crashes it's very big field to dig, to code. So, it's your decision. I think to make good crashes you need half of year of coding.

    As for stunts, there is my other asset based on this one:
    https://www.assetstore.unity3d.com/en/#!/content/72195
    with stunts :)
    So, you can do easy stunts but should code it yourself.
     
  40. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,490
    Isn't it just a case of attaching the camera object to the parent bike object?
     
  41. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,490
    You will need to spend a long time to make a game like that and a good one, bcman's asset is a great start and I suppose you can just build on that, make your own stunts/moves. I made a trial bike game, took me over 2 years to do, it's almost complete, learnt a lot over that period... one thing I can recommend you use for the rider physics is FINAL IK, that is an amazing package with very many uses, together with BCMAN's bike asset, should work well together :)
     
  42. maxtwoseven

    maxtwoseven

    Joined:
    Dec 13, 2016
    Posts:
    2
    Thanks, Khos. We did figure that out after a while. We made the camera a child object of the rider's head, which works fairly well. Unfortunately, the lean animations cause some motion sickness, so we'll have to figure out what to do about that.
     
  43. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,490
    Then you could consider to attach the camera/VR object on a different child object and/or remove the lean anims.
     
  44. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Yes, I agree with khos.
    To make VR cam smooth and stabilized(what your neck really doing) you need to detach it from rider head(because he moving a little bit more than really need. To be more cinematographic :)) and attach to bike.
     
  45. Alex-3D

    Alex-3D

    Joined:
    May 21, 2013
    Posts:
    79
    Hi, Boris
    What about c# code yet?
     
  46. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Hello, Alex-3D.

    Can't say for sure.
    There is some issues about strange not wanted drifting.
    To be a honest, it may take from two weeks to few months, until I'll back to this code again.
     
  47. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    same here c# version is welcome
    maybie 2d5 sample it's can be fun
     
  48. CarlitosZ

    CarlitosZ

    Joined:
    Jun 7, 2013
    Posts:
    3
    Hi! Does it work fully on Unity 5.6 ?
     
    woedev likes this.
  49. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Yes, of course.
    Tested with "Unity 5.6.0f3 (64-bit)"
     
    woedev likes this.
  50. Pilltech101

    Pilltech101

    Joined:
    Jul 25, 2014
    Posts:
    35
    Any news on a C# version?