Search Unity

I wanna go with physics to follow with my shuttle a mesh collider

Discussion in 'Physics' started by rolfwiechert, Mar 1, 2019.

  1. rolfwiechert

    rolfwiechert

    Joined:
    Feb 28, 2019
    Posts:
    3
    Hi all,

    we trying to find out any way to go with physics for following with a shuttle a rail which was designed with a mesh collider and runs only in one layer. The rails are existing only in straight rail sets and curcs with 90 or 45 degrees. I gonna upload some pics for my problem and yes we tried to go with bezier, but i would like to be more free for different rail setups and a bit more realistic. Are there any code examples or unity projects?
    You can see in the pic, i tried it with spheres and addforce ... i seems to be succesfully, but how can join this with my shuttle on the left?

    Many thx for all of your help ....
     

    Attached Files:

  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,776
    I am not sure what you exactly trying accomplish, but have you tried wheel colliders?
     
  3. rolfwiechert

    rolfwiechert

    Joined:
    Feb 28, 2019
    Posts:
    3
    Did you see my pic ?

    No, i used sphere colliders with the balls in the moment, but my goal to see my shuttle on the rail (track)
     
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,776
    Is there rail on the right (straight), or the rail, which is closed loop with balls (I assume second)?
    If you want strictly physics based, you could use wheel collider with pivots as joints.
    But I would perhaps keep simpler just to pivots, as moving anchor on the rail.
    You probably want two bogies, front and back, just like in train wagon?
     
  5. rolfwiechert

    rolfwiechert

    Joined:
    Feb 28, 2019
    Posts:
    3
    Yes, you right ... the closed loop and on the left ist the shuttle with 2 bogies. But i guess we can have oen bogie as a basic object and connect both bogies with a board etc. . How can i give 4 wheel colliders, because i have physically 4 wheels in each bogie? Is this an emtpy game object?
     
  6. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,776
    Wheel collider is a game object component. Search from the drop down list.