Hello!
Not too sure what category best fits this and sorry for the lengthly post but,
I’ve got this model thats just a bunch of edges that connect and create a path. I’m using the orange path as a practice go.
I’m wanting to import this into Roblox some how and make have a script that would automatically clone and make train tracks follow this path however I can’t seem to get it.
I’ve tried to each edge into a retangle by doing the following
I selected all edges and extruded downwards, I then applied the solidify modifier, deleted the extruded edges, bottom faces. I then selected all of the faces and then did checker deselect to have every second face, then I seperated the faces by selection which left me with 2 meshes and for both meshes I selected all the faces and extruded downwards again then I selected all faces and seperated by lose parts which left me with alot of rectangle like meshes. ^So this worked out all fine and nothing wrong with the model.
My idea was to have a script that loops through all the meshes and clones a base model of track, then it would set the models pivot point to the meshes position and then set the rail lengths to the same as the mesh and set the models rotation to be the same as the mesh. The problem with this is that when importing the meshes to Roblox the orientation imports as 0, 0, 0 which is wrong because alot of the rectangles are rotated. This is because the blender transformation properties are also 0, 0, 0 and unfortunetly there is no way to fix this and because of this the script would set the orientations of all of the tracks to 0, 0, 0 and the tracks would all face the same way and wouldn’t line up with each other.
I could do all this manually by dragging the track model onto the side the mesh and do this for all the meshes and then have a script that sets the positions and sizes but this would be extremely time consuming.
My other idea I’ve tried is to have the script do a raycast from the left of the mesh that gives me the normal that this raycasts hits and then find out the rotation that way. So far this is the best way but I’m having issues getting it perfect. Here is a placefile:
Track Layer.rbxl (204.4 KB) The script called TrackPlacer inside of ServerScriptService contains the code that places the track and some info.
My last idea is, would another 3D modelling software like autodesk maya or something have a feature that would set the transform properties to what they actually are instead of 0, 0, 0?
All I really need is a way to get the actual orientation of the meshes so the tracks could be laid properly.
Please help me! I’ve been stuck on this for a few days and gotten nowhere. Any help is appreciated!