Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[RELEASED] Simple Bicycle Physics

Discussion in 'Assets and Asset Store' started by AiKodex, Feb 2, 2022.

  1. John3D

    John3D

    Joined:
    Mar 7, 2014
    Posts:
    441
    Hi @Xpert3D ,

    If the biker crosses a finish line how would you make the biker stop from code, please?

    Many thanks in advance!!!

    Kind Regards,
    John
     
  2. AiKodex

    AiKodex

    Joined:
    Jan 21, 2021
    Posts:
    272
    Hello John,

    The easiest and the simplest solution would be to disable the script BicycleController.cs and increase the drag on the RigidBody component. A drag value of 20 or more will be effective.

    This will cause the bicycle to disengage with the controls while still keeping IK intact for the cyclist to put their foot down once the bicycle has stopped.
     
    John3D likes this.
  3. Rastar

    Rastar

    Joined:
    Sep 14, 2012
    Posts:
    73
    HI, thanks fo rthe info, will take a look. However, the approach for moving the bicycle when using an external trainer is probably somewhat different: You'll take either the current speed or power from the trainer and use that to either directly set the bike's velocity, or apply a force to it. Pedaling will just be an animation whose play speed is controlled by the measured cadence.
     
  4. John3D

    John3D

    Joined:
    Mar 7, 2014
    Posts:
    441
    It worked! Thanks!
     
    AiKodex likes this.
  5. John3D

    John3D

    Joined:
    Mar 7, 2014
    Posts:
    441
    Hi @Xpert3D ,

    Any plans for releasing a new update, please?
    I would love to see gyroscope for Left/Right movement.
    A change camera button would be nice: a simple way to have the main camera be parented in some empty game objects in order to provide multiple view angles like: wheel position, chest position, helmet position, top view, just to name a few. The button would just cycle through the predefined list.

    Thanks!
     
  6. AiKodex

    AiKodex

    Joined:
    Jan 21, 2021
    Posts:
    272
    Hello John,

    Thank you for your suggestions on what we could add to make the asset richer in terms of quality.
    We'd highly recommend handling camera's through the Cinemachine package by Unity. It offers next level control on cameras. You can implement any camera angle at any position along with settings like collision detection for the camera which could be useful especially while dealing with dynamic fast paced world scenes.
     
    John3D likes this.
  7. John3D

    John3D

    Joined:
    Mar 7, 2014
    Posts:
    441
    Thanks for your reply!
    I find your recommendation to utilize the Cinemachine package by Unity particularly interesting, as it indeed promises significant enhancements in camera control.
    However, I must confess, I am not yet entirely familiar with the process of implementing Cinemachine in my project.

    I wonder if you could assist me further by providing some guidance or resources that can help me better understand how to use Cinemachine with Simple Bicycle Physics?

    Your assistance would be greatly appreciated as it would not only help enhance my project (90% complete now) but also help others that have bought your very nice asset!


    Thank you once again for your valuable input and in advance for any guidance you can provide. Looking forward to hearing from you soon.

    Best Regards,
    John
     
  8. unity_t1N5M9EGrmR-lg

    unity_t1N5M9EGrmR-lg

    Joined:
    Jun 22, 2023
    Posts:
    1
    how do i make her bend more in the curves?
     
  9. SAMYTHEBIGJUICY

    SAMYTHEBIGJUICY

    Joined:
    Jul 12, 2023
    Posts:
    19
    Hey - trying this forum as I'm not getting replies on the emails or the enquiry form on the site. Has anyone tried the mixamo mapping recently using the extension? I can't get it to work after following both the original tutorial and mapping everything manually and even using Rowlan's extension. Whenever sprint is activated the spine falls through the floor and there is an error on the left foot mapping.

    I also have been trying to get a response on the best way to modify the input controls from the getkey/axis inputs to let's say just a regular calculated speed float that might come out of a trainer. The asset is described as "trainer ready" but I can't see the logic by which I might implement this. Would really appreciate some guidance.
     
  10. AiKodex

    AiKodex

    Joined:
    Jan 21, 2021
    Posts:
    272
    Hello,

    Thank you for reaching out to us here. We have been having a few issues with our mailer recently. If you could send us your email, we'd be able to reach out to you via another address.

    Please could you tell us if you are using a mixamo rig and have set it to humaoid? This is the most common error faced by developers.

    You can look into the CustomInput() and the ApplyCustomInput() function (in the ApplyCustomInput function, lines 406 and 407 depending on the version of the asset) in the BicycleController.cs script. You can pass your sensor input instead of the getaxis variables of the trainer directly. You may also control the speed of the bicycle programmatically by changing the acceleration curve of the bicycle.

    Hope this information helps.
     
  11. SAMYTHEBIGJUICY

    SAMYTHEBIGJUICY

    Joined:
    Jul 12, 2023
    Posts:
    19
    Thanks so much for replying!! I managed to modify the custom inputs to get sensor data into the game so all good there thank you.

    Regarding the character mapping I'm still having trouble and I feel like I tried everything - I import a mixamo character as fbx for unity, change to humanoid, extract materials, reset transform, setup the character using SBP menu item, set as child object of the bike then use rowlans extension to do the mapping. The process seems to work fine but the result is just always off:
    upload_2023-8-20_11-2-18.png

    The left foot never really maps correctly and he never really sits on the seat. It's all very jittery as well.

    You can email me at skjbukowski@gmail.com - I'd be really happy to work with you on this and maybe even commission you to fix it as this would open up a lot of possibilities for our game. Thank you please let me know (also how is it going on the TT bike demo you had before)

    EDIT - pretty sure it's with the asset rather than my mapping - I just tried a non mixamo rigged character from the unity asset store and mapped it myself and got the same issue with the left foot. :( upload_2023-8-20_16-18-21.png
     
    Last edited: Aug 20, 2023
  12. AiKodex

    AiKodex

    Joined:
    Jan 21, 2021
    Posts:
    272
    Thank you for attaching the screenshots.

    You mentioned you have tried the Mixamo auto rigger to obtain Mixamo rigs. That usually works flawlessly with the asset. The mappings you show makes it seem like rig differences is causing this.

    Have you tried manually assigning the values? Have you had any troubles with that?
     
  13. SAMYTHEBIGJUICY

    SAMYTHEBIGJUICY

    Joined:
    Jul 12, 2023
    Posts:
    19
    Hey AiKodex - thanks so much again for replying. I found the issue! After applying the "Setup Selected" from the toolbar there seems to be a slight bug where the right foot IK target never gets mapped in the anime controller script. I wanted to share this here in case other people encounter it. Hope this helps someone.

    upload_2023-8-22_23-36-54.png

    Also I saw earlier in the forum you said that you sent detailed instructions to one query on how to change to a new rigged bicycle. Would you please also send these to me at skjbukowski@gmail.com I would really appreciate it!
     
  14. AiKodex

    AiKodex

    Joined:
    Jan 21, 2021
    Posts:
    272
    Perfect! We're glad it works now for you.
    Sure, we have emailed you the guide for changing bicycles. Please do note that it is a bit more involved because of small parts like pedals and crank of a bicycle that need to be physically animated.
     
    SAMYTHEBIGJUICY likes this.
  15. charlestango

    charlestango

    Joined:
    Jun 7, 2022
    Posts:
    1
    I just bought this asset and it's GREAT! We're working on adding this to our open world platform to let players ride the bike in our city. We're using Mirror networking for our open world platform so we're working on getting Simple Bicycle Physics to work with Mirror.

    I see from an earlier message that you're looking into developing a multiplayer add-on for this asset. Any luck in getting this done? I'd love to buy an additional multiplayer add-on especially if it uses Mirror networking.

    While working on making this play nice with Mirror, we're running into some weird issues where Mirror's physics is clashing with the physics in this asset. The bike's sliding when turning.

     
  16. NeverSphere

    NeverSphere

    Joined:
    Sep 13, 2023
    Posts:
    1
    hey, I was recording for the waypoint on vsync on and frame increment is set on 2 and when i load and played it it always first skips first part of the track and then go slowly to destination. if I increase frame count then it starts glitching and turns are everthing got worse.

    I solved it was my code problem
     
    Last edited: Sep 21, 2023