Animating collision mesh?

Discussion in 'Content Creation' started by Arcanox, Dec 30, 2018.

  1. Arcanox

    Arcanox
    Expand Collapse

    Joined:
    Aug 22, 2018
    Messages:
    290
    I'm working on an experimental "automated guideway" or "peoplemover" train system in BeamNG. The vehicle drives on 8 rubber tires and uses 8 other horizontal rubber tires to "guide" it in a track, similar to the trains seen at various airports. I'm currently trying to figure out a way to make track switches. The current method I'm trying is to use a middle "guide rail" that some floater nodes collide with, guiding the wheels through the correct switch path depending on which way the switch is set. The part I'm struggling with is animating the collision mesh. I have the actual animations set up in 3DS Max, and I can trigger them through the dev console in-game, but the collision mesh (which I've set as "Visible Mesh" in the world editor) seems to use the initial shape and doesn't update with the animations. Is there a way to do what I'm trying to do?

    Here's a quick video of the animation in question:
     
    • Like Like x 1
  2. Average Person

    Average Person
    Expand Collapse

    Joined:
    Jul 8, 2015
    Messages:
    582
    you can only alternate collision meshes, unless you want to make a colmesh for each frame or make a jbeam you can't animate the collision mesh.
     
  3. Arcanox

    Arcanox
    Expand Collapse

    Joined:
    Aug 22, 2018
    Messages:
    290
    Is it possible to swap collision meshes via Lua? I only need the two states (switching side, and switching straight) collision-wise; the smooth animation is just for aesthetic purposes.
     
  4. Blijo

    Blijo
    Expand Collapse

    Joined:
    Apr 27, 2016
    Messages:
    2,055
    I don't think this is possible yet. Please let me know if I am wrong
    I have been playing with the idea of making some switch for my tram and other train mods too.
    My current ideas are:
    1: jbeamed switch. Works like the animation but is actually a pre spawned vehicle. Obvious downsides are putting it on the map, controlling it, FPS etc.
    2: a middle lane in the tramways and a hydro-operated 'feeler' on the trains that can go to the left and right. If there is a switch, the middle lane gets wider so you have time and space to move the feeler, at the actual switch part, the hydro gets locked in the 3 rail that splits up. Then the feeler guides the train trough the switch.
    Downsides:
    Can be annoying with multi axled vehicles.
    Can be annoying with trains with separate carriages, how to time it.
    Unrealistic for my purpose, might be just fine for yours.
    3: thrusters or rotators in the bogies or wheels to get some kind of steering force.
     
  5. Arcanox

    Arcanox
    Expand Collapse

    Joined:
    Aug 22, 2018
    Messages:
    290
    Actually, that idea might work. The challenge for me is going to be making the guide rail break for the tires to go through it (when taking the opposite route), but I could make the guide nodes on the train slide on a slidenode and use a hydro to move it. That'd allow the autonomous script to choose the path as well. Collision groups would be awesome in a future game update...not sure if T3D supports that or not.
     
    • Like Like x 1
  6. Average Person

    Average Person
    Expand Collapse

    Joined:
    Jul 8, 2015
    Messages:
    582
    I think someone used it on one of their maps for a garage door
     
  7. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    I'd try putting the guidance wheels on hydros/otherwise length changing beams so that you can force them outwards, if the vehicle wants to take a left/right detour it can increase the hydro force on the opposite side so it's being pushed into the new direction.
     
  8. Arcanox

    Arcanox
    Expand Collapse

    Joined:
    Aug 22, 2018
    Messages:
    290
    I got it to work using a little movable guide node that fits in groves under the track. It's not perfect, but it's the best solution I could come up with that works without dynamic collision meshes. I'm waiting on a video uploading showing off the system I have so far; I'll post again once it uploads.
    --- Post updated ---
    Here's the video!

     
    • Like Like x 3
    • Staff Pick Staff Pick x 1
  9. Blijo

    Blijo
    Expand Collapse

    Joined:
    Apr 27, 2016
    Messages:
    2,055
    Heh. That is exactly what I had in mind :D
    Nice to see it working!



    Maaaybe it is an idea to use this system in trains and trams? You could make the switcher tail even narrower and only use the sliding node for the collision with the switch.
    That would work better with trains and trams that drive on rails with roads.
     
  10. Arcanox

    Arcanox
    Expand Collapse

    Joined:
    Aug 22, 2018
    Messages:
    290
    The collision engine doesn't like thin surfaces very much, so making it smaller might have mixed results, but it'd be worth a shot.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice