Search Unity

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

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice
  3. Improve your project's performance with our new guide on profiling in Unity.
    Dismiss Notice

Animated Steel Coaster

Discussion in 'Assets and Asset Store' started by IllusionLoop, May 22, 2017.

  1. IllusionLoop

    IllusionLoop

    Joined:
    Apr 11, 2015
    Posts:
    51
    Last edited: May 22, 2017
  2. iLyxa3D

    iLyxa3D

    Joined:
    Sep 25, 2013
    Posts:
    31
    I created track using "Coaster Station For ZFTrack" prefab. How to control initial delay time, start/pause/restart riding?

    UPD: found Station script at first track element and Send function in it..

    ..but how easy to restart it, if track is not loop?! it is huge problem..
     
    Last edited: Jun 25, 2017
  3. IllusionLoop

    IllusionLoop

    Joined:
    Apr 11, 2015
    Posts:
    51
    Hi, sorry for the delay. For everyone who didn't find out yet how to change the station settings:
    Inside the 'Coaster Station for ZFTrack' object there are several 'Station Track ZF' Objects. Select the first one and you can scroll down in the inspector to find the 'Station' script with all the settings. It is also described here: http://illusionloop.webflow.io/docs/animated-steel-coaster#Tracks-And-Rails-Section

    Unfortunately there is currently no method to reset the train, but i can add this to the next version.
    Would reloading the scene work for you?
     
  4. IllusionLoop

    IllusionLoop

    Joined:
    Apr 11, 2015
    Posts:
    51
    I just checked this: As long as the carts did not derail, you can simply reset their position and rotation by script and set velocity and angular velocity to 0.
    For example:
    Code (CSharp):
    1.  
    2. public GameObject[] carts; //assign the carts using the inspector
    3. void Start () { // save initial position and rotation of each cart
    4.        startPosition = new Vector3[carts.Length];
    5.        startRotation = new Quaternion[carts.Length];
    6.        for (int ct = 0; ct < carts.Length; ct++) {
    7.            startPosition[ct] = carts[ct].transform.position;
    8.            startRotation[ct] = carts[ct].transform.rotation;
    9.        }
    10.    }
    11. void ResetCarts(){// call this to reset the carts
    12.     for (int ct = 0; ct < carts.Length; ct++) {
    13.         carts[ct].GetComponent<Rigidbody>().velocity = Vector3.zero;
    14.         carts[ct].GetComponent<Rigidbody>().angularVelocity = Vector3.zero;
    15.         carts[ct].transform.position = startPosition[ct];
    16.         carts[ct].transform.rotation = startRotation[ct];
    17.     }
    18. }
    I will add a controller script like this in the next update
     
  5. IllusionLoop

    IllusionLoop

    Joined:
    Apr 11, 2015
    Posts:
    51
    Version 2.1 is now online with these new features (Plus only)
    - Prefab with mobile optimized shaders
    - Method for resetting and sending the train at runtime
     
  6. moreirac

    moreirac

    Joined:
    Oct 9, 2017
    Posts:
    5
    Hi,

    I have a sequence of points that I want to interpolate and generate a random track that fits all points (procedural). How hard is this to do with this package?

    Thanks!
    Caio
     
  7. IllusionLoop

    IllusionLoop

    Joined:
    Apr 11, 2015
    Posts:
    51
    Hi,
    this package does not contain a curve editor. You need another package to get this functionality.
    ASC Plus is compatible with Tracks and Rails: http://u3d.as/cyV
    You can use the combination of both assets to instantiate curves along your path. It shouldn't be that difficult if you can write c# scripts. You can take a look at the 'CoasterStationLXRZF.cs' script. it creates the station, lift and brakes when you drag the prefab into the scene. I used reflection for this script, which makes it more complicated, but you don't have to do that.
     
  8. imunity3d

    imunity3d

    Joined:
    Jul 29, 2014
    Posts:
    1
    Hi,

    I want to build an exe with a limited number of iteration. For example, I want to repeat the roller coaster 5 times and then it will stop automatically. How can I do that? I appreciate your help.

    Thanks.
     
  9. IllusionLoop

    IllusionLoop

    Joined:
    Apr 11, 2015
    Posts:
    51
    Hi,
    the length of one lap is 69.008s. To stop the animation, you can call this method after the desired time:
    [your coaster object (Transform)].getComponent<CoasterControllerSWLXR>().SetSpeed(0);
     
  10. Iucounu

    Iucounu

    Joined:
    Oct 24, 2017
    Posts:
    19
    Hi there, your package looks great and I was about to buy it, but then I watched your youtube video once again and noticed what appears to be animation errors.

    Code (CSharp):
    1. https://www.youtube.com/watch?v=y7BeGF49Lks
    On 0:22 (big issue) and 0:25 (small issue) it's clearly visible the car goes off tracks for a few frames, as if it hits some obstacle, and then resumes correct path. I assume those are small errors in positions/rotations of key points in animation curves. Since on the asset store it says the animation is baked to keyframes I think that means I won't be able to edit animations on my own. So before buying I wanted to clarify if those errors were fixed in the current package (and if so, is there a video showing the full track)?
     
  11. IllusionLoop

    IllusionLoop

    Joined:
    Apr 11, 2015
    Posts:
    51
    HI,
    i fixed these points as good as possible. The animation now looks like in this video:

    The errors were caused by interpolation between keyframes. Unity sometimes rotates objects in the wrong direction when the keyframes are close to -90° or 90° (vertical). I changed the interpolation type of these keyframes to fix it.
     
  12. Iucounu

    Iucounu

    Joined:
    Oct 24, 2017
    Posts:
    19
    Thanks. While the first (big) issue is fixed, there are still two smaller errors remaining, at 0:05 and 0:07. The car visibly jitters to the right for a few frames, and then resumes correct path. The rest of animation is perfect, and since the car moves smoothly along far more complex curves, I think it shouldn't be too difficult to fix those two errors.

    I apologize for bothering you because of such minor issues, but since all animation is baked and can't be edited (I think?) I foresee already how such minor issues can become a real pain kind of ruining the entire thing. Please consider fixing those in next update. I'll buy the asset right away when the animation is fixed.
     
  13. IllusionLoop

    IllusionLoop

    Joined:
    Apr 11, 2015
    Posts:
    51
    Unfortunately it is quite difficult to fix, but i can try again.
    It's just one frame, where the cart faces exactly 90° up or down. If i remember correctly the rotation requires a small offset there, because otherwise the cart performs a 'backflip'.
    The animation can be edited, but there are lots of keyframes ;)
     
  14. Iucounu

    Iucounu

    Joined:
    Oct 24, 2017
    Posts:
    19
    Well, please give it a try then.
     
  15. IllusionLoop

    IllusionLoop

    Joined:
    Apr 11, 2015
    Posts:
    51
    This is whats technically possible. I'll upload the new version (It should be available in about a week).
     
  16. Iucounu

    Iucounu

    Joined:
    Oct 24, 2017
    Posts:
    19
    Thanks. Looks good now. I bought the asset today.
     
  17. IllusionLoop

    IllusionLoop

    Joined:
    Apr 11, 2015
    Posts:
    51
    Great, thanks!
    The update is now available
     
  18. zhao_KK

    zhao_KK

    Joined:
    Jun 7, 2017
    Posts:
    11
    HI,
    When I want to create a track myself, I get this error:
    'Tracks and Rails' asset was not found.Please make sure 'Tracks and Rails' by zen fulcrum llc is installed properly and click 'retry'

    How can I fix it?

    My version is 2017.3.1f
     
  19. IllusionLoop

    IllusionLoop

    Joined:
    Apr 11, 2015
    Posts:
    51
    Hi,
    I assume you are using the latest version of both assets?
    This might be a bug with .asmdef files, if I remember correctly. It should be fixed though. I'll check again.
    In the meantime, you could try using a different Unity version. That might fix the issue.
     
  20. IllusionLoop

    IllusionLoop

    Joined:
    Apr 11, 2015
    Posts:
    51
    I just tested the package with Unity 2017.3.1f1, but it works correctly.
    Can you give me more information on the issue? Did you change anything after importing or imported incomplete packages?
    The script tries to find certain components of the tracks and rails asset package. The error appears if it was unable to find 'track cart', 'track' or 'station' scripts of tracks and rails.
     
  21. zhao_KK

    zhao_KK

    Joined:
    Jun 7, 2017
    Posts:
    11
    I think I know why.
    Since the review was not in place, I thought your program could run separately.
    So before I did not buy the 'Tracks and Rails' plugin.
    Sorry for the meaningless reply.

    the best
    Zhao
     
  22. BadaiRei

    BadaiRei

    Joined:
    Jan 27, 2021
    Posts:
    2
    hi. got your package (Hope you're still updating it).
    I was wondering if there is a way to slow down the speed not during run time?
     
unityunity