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
    I'm planing to finish C# in 2017 but have no any progress yet.
     
  2. BlanketsWilson

    BlanketsWilson

    Joined:
    Jan 8, 2017
    Posts:
    11
    This asset looks great, I plan to buy it. Are you able to replace the character with your own?
     
  3. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Hello, BlanketsWilson
    Thanks for your words :)
    Yes, it's possible. There is documentation with explaining how do you need to prepare character to make it works in this asset. So, you just should follow the doc.
     
    BlanketsWilson likes this.
  4. luftwaffe2020

    luftwaffe2020

    Joined:
    Jan 19, 2015
    Posts:
    5
    Hello !

    Is it possible to make an AI Biker with this asset ?
     
  5. bcman

    bcman

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

    Yes, you can control other bikes by AI if you know how to code it.

    I've got this demo long time ago for Unity4(only available by old Unity's web player - works in IE and Firefox).
    http://unitybike.ucoz.com/new_bike/Build.html
    There is some kind of Road Rash game, where you can punch and kicks AI enemy rider.
    AI riders races with you and try to make some damage to you too :)

    But you should write your own code for AI.
    I mean there is script to control the bike and your part of job to code new script which will control AI bikers(use waypoints, navmesh or so and turn steering bar to ride through this)
     
  6. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Now it's available in C# !
    Many thanks to all people who helps me to rewrite it. Thank you, guys.
    It was a challenge for me :)
     
    hottabych likes this.
  7. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,490
    Can't play your one video, due to blocked in my country, see screenshot: save.PNG
     
  8. Deleted User

    Deleted User

    Guest

    Maby he used Garage Band?
     
  9. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    hi what's new on this version ?
     
  10. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Last edited: Aug 18, 2018
  11. BesaneGames

    BesaneGames

    Joined:
    Mar 24, 2014
    Posts:
    1
    Hi, I just want to confirm: will this run on unity 2017.x?
     
  12. bcman

    bcman

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

    Yes, it's will run on Unity 2017.x.

    Sorry for long answer.
     
  13. arcsen7

    arcsen7

    Joined:
    Jan 12, 2019
    Posts:
    1
    Hey man, I really love your asset but I have a question! Do this asset have the texture of the rider? I mean the appearance of the rider. Thanks a lot!
     
  14. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,490
    It would be nice if you could add a demo with a real person/mesh included, can I request that?
     
  15. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Hello, guys.
    In that asset I've released physics of bike and rider.
    It's just a code to make any bike and any character ride like that.

    All people around has different projects with different graphic styles.
    So, I meant everyone who wants to make this kit working within own project can easily change bike and rider.
    To make it without code rewriting you need a new character(textured or not - it doesn't matter) with skeleton compatible with Unity mecanim. The procedure how to change character, rig character, bones naming is described in manual.
     
  16. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Believe me, I've tired that but 'real character' looks a little bit stupid on cubic untextured bike. A textured bike seems stupid too on low polygonal environment.
    Making real-life biker, real life bike, real-life environment is too much for 'physics' asset :) It's not just a lot of work(months) but making it little out of focus of asset - realistic physics of motorcycle.
     
  17. Plasticlay

    Plasticlay

    Joined:
    May 6, 2016
    Posts:
    16
    Hello, just purched your controler really fun to play with.

    I have two quetions..
    1. - im working in the mobile template, Id like to make the Left joy stick down funtion activate the rear breaks and not the front. can you guid me to where i need to make this change.?

    2. - I saw there is a kick and punch animaiton. do you have a script to make this functional?
     
  18. Warlordor

    Warlordor

    Joined:
    Jun 30, 2019
    Posts:
    2
    Hi there, throwrocks.
    1. There is few ways:
    a) change it in Unity's Edit/Project Settings/Input/Axis then remap joystick axes vertical to key 'X'
    it's rough but easy way. Bad side is you'll get no 'analog' power of brakes just 'on' an 'off'
    b) find script 'mobileControls.cs' and remap left stick. Strings 61 and 94
     
  19. Student4Life

    Student4Life

    Joined:
    Sep 28, 2016
    Posts:
    27
    hey bcman, does the turn radius feel correct to you on the sport bike (when going fast?)
    I ready your description about trying to model real life.
    It feels like a slow turn to me, looking for something a little more arcade setting.
    BEAUTIFUL ASSET!! so cool
     
  20. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    H there, Student4Life.
    It seems I am already answered this question... but where ? :)
    Okay. You might change it in bike settings by changing curve at the end(maximum speed).
    But as I wrote in manual motoGP bike's has 1.5 degrees of handlebar's turn restrictor because that's what you need when turning at 250km/h.
    The reason why I district it is for keyboard users who can't turn slowly. At high speed full turning of handlebar causes crash everytime.
     
  21. Fibonaccov

    Fibonaccov

    Joined:
    May 5, 2020
    Posts:
    58
    Impressive asset @bcman

    Got a couple questions:

    1) Are the Motorcross physics and bike (showed in the asset store for this asset) part of it?

    2) Have you been able to address the front wheel sinking? I have a 3-wheeler controller and only seeing this issue very rarely.

    3) Do you have the mount and dismount animations by any chance? Would have been great from a 3-person view.

    Thanks!
     
  22. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Hello, Fibonaccov.
    1. The motocross bike is included into SPK. The bicycle has very similar physics but it part of other asset - BPK.
    2. Best solution is make a smaller visual wheel than wheelCollider. The problem is in changing center of mass and front fork which trying to press it under ground. And it's possible due Unity's physics(nVidia PhysX) is bad :)
    So, your task it fix bad build-in physics :)
    3. I didn't make this animations coz my asset is about physics not GTA gaming :) It's not only animations but char behavour and so on. Too large and complex for small bike's physics asset.
     
    Fibonaccov likes this.
  23. prashantagent47

    prashantagent47

    Joined:
    Jan 2, 2016
    Posts:
    5
    @bcman
    i bought this plugin few days back,
    just wanted to know how i can turn off leaning of bike, i want bike to stay straight,
    Please help ASAP.
    thanks
     
  24. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Hi there.
    You request seems a little bit strange :) because bikes is about leaning. That’s why they turns. Really.
    But, you may select rigid_bike, find Rigidbody component then Freeze rotation X axis. It will a reason of problems with turning but it's easy way.

    The better solution is hide my bike and make another one as child of hidden real one. This 'faked bike' must have no controls and rigidBody/collision/wheelColliders components. And then freeze X axis of this 'faked' bike. But it requires of code knowledge on your side because you need to copy wheel rotations/steering angles, imitation of suspension works as original hidden bike and copy all other visual functions from hidden real bike to 'faked' one.
    As result you'll get absolutely not leaning bike with same physics.
     
  25. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,490
    Hey Bcman,
    Question if ok: I using the rigid_bike prefab in the scene u5bike_JS_motard, if I scale the bike up to 2 (it is 1) it falls over all the time, what do I need to adjust to make it balance? eg.the CentOM object needs to move up or down?
     
  26. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Quick answer is yes, put down CoM. And maybe real wheel collider sizes. Also a mass.

    BUT STOP doing this!
    It's totally wrong to make things not in real-life scale. It's will break everything. Because you need new mass, new formula to keep steering wheel straight(because your speed seems to be scale x2, so your bike should ride at 400km/h not 200 as before).
    Your bike can't lean to much because new turning speed is x2 too.
    Unity build-in physics requires real-life scale it's wrote in manual of any PhysX document.
    So, your can but do not do that. Change scale of your project if your project is about physics.
     
    khos likes this.
  27. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,490
    Many thanks! Will take note :)
     
  28. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,490
    Seems like I might get it to work (ok ish):
     
    newlife likes this.
  29. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    This advice applies to transform scaling, but model scaling (in the importer) will give correct results?
     
  30. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Nice work, khos!
    As for my opinion bike is not leaning enough according to animation :) I for that slow speed bike should lean more to looks more realistic. Or suppress rider animation alot. But it's only visual recommendation, it's up to you how your project should looks like.

    As for question of hopeful I can't say for sure what kind of bugs in any scenario(scale transform or scale model) you'll get. But weight of 'vehicle' still same, the speed is same.
    So, your visual will be corrupted because visual scale of model will not match speed of new scale.
    Also, new wheel sizes doubles acceleration but motor power will be not enough to reach speed x2.
    Well... you might to fix all those problems but it's much easier to do not make it for yourself :)
    I don't try to say 'any scales is impossible at all'. Just want to warn you - by doing this you tie the heavy stone to your neck while trying to swim across river.
     
  31. WOEaintME

    WOEaintME

    Joined:
    Feb 14, 2022
    Posts:
    1
    This looks great, does it work with Unity 2020.3?
     
  32. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    Hi there, WOEaintME.
    Honestly, I did not tried because I work on 'Unity 2020.2.1f1 (64-bit)' and it works well.
    I don't think 2020.3 too different in physics compare to 2020.2 :)
     
  33. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,490
    Hi BCMan, would it be possible to ask for some guidance for your awesome asset?

    -While the bike/rider is moving, would it be possible to make the rider stand up, instead of sitting, I guess that is animation related, or can IK help?

    -How is it best to adjust the rider, e.g. this pic, the shoulders look too high/not relaxed :), how to adjust, maybe the IK but I cannot see any IK stuff for it, maybe I just being daft here :) ?
    upload_2023-5-21_23-5-36.png
     
  34. Warlordor

    Warlordor

    Joined:
    Jun 30, 2019
    Posts:
    2
    khos, hello there.
    Yes, it's the pose of rider is depends on idle pose of animation(1 frame as I remember. there is no 'real' animation because it animated by bike's movement and IK).
    The rider is "IKed" to wheel bar's handles and pedal for feets.
    I have no this code at my eyes this moment, so can't say what frames 'idle' animation is but give me a few days to find it out.

    The solution as add new animation called kinda 'stand idle' and make it 1 frame(no animation as fact :)) but biker should stand. The most trick thing is switch standing/sitting animations depends on situation.
     
    khos likes this.
  35. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,490
    Ok thank you, I wonder if I can add IK to the spine etc.
     
  36. bcman

    bcman

    Joined:
    Feb 9, 2013
    Posts:
    139
    khos, hello.

    There is few modes in project: for sportrider, chopper and enduro.
    All made same scheme but different animations(depend on pose which is obviously different for different kinds of bikes).
    Let's take for example "char_anim" - sport rider.
    0-29 frames is idle animations where biker is breathing, also there is some other animations like move keen to outside when leaning, looking back when biker going back and so on.

    Also, there is few IK joint's in hands to stick it to bike's steering bar handles.

    To achieve stading pose you need to change animations you want to use:
    0-29 - idle - just make it stand pose
    30-49 - lean right - make new animation like 'idle' but with head turnded right - that's how standing stunt riders turning(enduro riders mostly sits down while turns)
    50-69 - lean left - same anims as above but left side

    That's it. Just reimport the model.