Jump to content

Runtime roads


Fafhrd

Recommended Posts

So a few of my objects register themselves with a custom script that is aware of the blank road spline object. They add themselves as thus:

GeNaNode node = spline.CreateNewNode(t.position);

spline.AddNode(node);

While playing (in scene view), I can see the nodes, yet they do nothing. I can manually add a few more which behave as they should even at runtime, but my programmatically created ones do nothing.

Am I missing something?

Link to comment
Share on other sites

  • 2 weeks later...

Hey @Fafhrd,

The reason why this isn't working as expected is because the function 'AddNode' inside of GeNaSpline is a way to essentially 'subscribe' new nodes created with the Spline. It is not in charge of creating curves between them which is what I think you are asking here.

If you would like to learn more about how the GeNa Spline system works, you can check out our Demo project that comes already installed with GeNa and is located under Procedural Worlds/GeNa/Asset Samples/Script Examples.

I would suggest opening the RuntimeDemo scene inside of the Scenes folder in the above directory:
image.png

And opening the 'GeNaRuntimeExample' script. In here you will find a function called 'SplineSpawn' and it shows that you must use 'spline.AddCurve' along with the two nodes you wish to connect together. 

It's also worth noting that 'CreateNewNode' automatically calls 'AddNode' internally.
image.png

Hope this helps! Let me know if you need further assistance! 🙂

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...