Importing paths in Unity from 3d app

The past days I’ve been trying to find the best way to import quickly paths from my 3D application to Unity…and I’d like to share my findings.
So… imo the quickest way for me was getting the “Path Controlled Character” tutorial for iTween and using the “PathPoint” and “Controller” scripts.

Anyhow, from your 3D application:

  • Convert nurbs splines to linear curves (in XSI I just do extrusion along axis using Local Axis)… anything that gets the job done and gives you the more control points along your spline.

  • Make a null, move it and snap it on the first path control point. Duplicate null and repeat procedure until all control points have nulls on them.

Export FBX and import in Unity.

  • Assign “PathPoint” script to each of the nulls
  • Make a GameObject, attach a Controller script and then assign the nulls in the Controller’s “Control Path”.

and voila you have a nice path.

p.s.
I tried attaching nulls in the original nurbs spline control points but the curve generated in Unity didn’t match.

Maybe it helps if I add what I have done so far. I’m not familiar with the PathPoint script, but I think this should still be useful.

Take your curve, and extrude a mesh out of it, but leave sides and back away, so you only get the top. This will give you one polygon that follows your path.

Now you can access the MeshFilter in Unity with a script and read out the vertices, which should still be in the correct order of your curve.

I think it should be much less work than having to attach a component to every single null and to snap nulls to all the controls points. Especially if you have paths with hundreds of points.