I also worked in a teleport script that doesn't fail. A kart goes in a "teleporter" and it's location is moved to the designated destination.
Finally, I ended up creating a track layout and terrain that can be used to replace what we already have, at least until I create something better.
This is one of the terrains that uses a heightmap created in World Machine. Using the free Terrain-Toolkit addon for Unity, I was able to procedurally texture the terrain based on heights and slopes.
Here you can see that there is a "teleporter" box and a "teleport destination"box. Once the kart hits the teleporter, it's position will be moved to the start of the new track. Unfortunately I have to make sure that the teleport destination is facing the same direction as the original location, otherwise the kart is likely to go flying off the track.
Here is the script that was used to make a successful teleporter.
As you can see above, I've been experimenting a lot in 3Ds Max with different techniques in creating a track layout. I've finally decided on a technique that I discovered on my own after a lot of experimentation. Here it is (mostly for my benefit):
- Create a spline over an uneven terrain
- Download the "Align Vertices to Mesh" script by Klaas Nienhuis here and run it in Max.
- Select all of the vertices on the spline, right click and hit smooth.
- Deselect from vertex mode and select the entire spline again. Under the modifier list select normalize spl. and then convert to editable spline.
- Go in the top-viewport and open the "Align Vertices to Mesh" script. Click "pick base mesh in viewport" and select the terrain. After making sure that your spline is selected, hit "Go: entire object". The spline should be perfectly aligned with the terrain now.
- Under Editable Spline - Rendering, select "enable in viewport", "generate mapping coords", and "rectangular". Customize the length and width of your rectangle. Once satisfied, convert your spline to an editable poly.
- Select all of the horizontal edges on top of the track. click connect to add 2 edges on opposite ends of the track that run the entire length of it.
- Now select the entire edge on one side of the track and click "create shape from selection". You might get something really weird on the screen. This is because you need to turn off "enable in viewport" under the rendering panel for your new spline. Once that is done, it should just be a new spline running the length of your track on one side.
- Repeat step 8 for the other side of the track.
- Create a railing under "aec extended". Modify its parameters so that you get a good size for the track.
- Click "pick railing path" and choose one of your new splines on the road. You'll have to increase the number of segments so that the rail curves along with the track.
- Click the "post spacing" button and increase the count to a higher number. Once that is done, you might want to decrease the number of segments for your railing again as you might have too many faces now.
- Repeat steps 11 - 12 for the spline on the other side of the track.
- You should have a simple track with railings on both sides now.
This area here I just started on; it might or might not pan out though. I wanted to see if there was a certain technique for carving a tunnel into the mountain that follows the layout of the road. I was thinking that this might be possible by creating an edge that follows the curvature of the track down the middle. Then I would turn that edge into a spline and convert it into the shape of an arc or something. Then hopefully I would find some way to use that arc to cut a path into the mountain.
No comments:
Post a Comment