Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Bézier Path Creator (free)

Discussion in 'Assets and Asset Store' started by SebastianLague, Feb 3, 2019.

  1. SebastianLague

    SebastianLague

    Joined:
    Aug 31, 2014
    Posts:
    111
    Hello, I've created a tool to quickly and easily creating paths for your game. You can make objects move along these paths, or use them as a guide for spawning objects and generating meshes.

    You can download it for free from the asset store.
    See the user guide for a full run-down of the features, or have a look at the video below for a quick overview.
    I hope this will prove useful to some of you!

     
    HonorableDaniel and Mark_01 like this.
  2. Kellyrayj

    Kellyrayj

    Joined:
    Aug 29, 2011
    Posts:
    918
    Super excellent tool! Thank you for sharing.

    I am trying to understand how I can modify the tool to be able to see the path in the editor when I don't have the path selected. any clues as to how I could make this happen?
     
  3. SebastianLague

    SebastianLague

    Joined:
    Aug 31, 2014
    Posts:
    111
    Hi, if you get the latest version from my github you can enable this as an option in the path settings. https://github.com/SebLague/Path-Creator
     
    Kellyrayj likes this.
  4. Kellyrayj

    Kellyrayj

    Joined:
    Aug 29, 2011
    Posts:
    918
    Hi @SebastianLague! Thanks for your speed reply before.

    I've another question for you. I've created a follow path script very much like your example. I'd like to be able to send Unity Events based on where an object is on the path. For instances, if the end of path instructions is set to stop, I'd like to be able to send an event when the object reaches the end of the path. Thoughts on how I can go about doing this?
     
  5. VanDraven

    VanDraven

    Joined:
    Oct 31, 2012
    Posts:
    2
    Hi, you've made a great tool! I've even signed up to your Youtube channel!
    It seems the path is locked in place, is there a way to move it with the object the script is attached to?
     
    Last edited: May 17, 2019
  6. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    674
    Thank you so much for making this tool, it saved me a tremendous amount of time and frustration. :)

    It's probably far outside the scope of what you had in mind, but do you have any suggestions for how we could go about merging meshes if we wanted to have multiple paths cross over each other or form intersections without z-fighting?
     
  7. rudomanenkoanton

    rudomanenkoanton

    Joined:
    Jun 27, 2019
    Posts:
    1
    It seems like there are some mistakes in documentation. When I want to create path from script I use method GeneratedPath from doc. But if I convert bezier path to Vertex path, like in documentation, I get the error message, that Vertex path constructor get more than one parameter.
     
  8. Balours

    Balours

    Joined:
    Nov 27, 2013
    Posts:
    52
    Hi, is there a way to change the color of a curve in the editor without changing the color for every curve?
    Thanks!
     
  9. mckelynn

    mckelynn

    Joined:
    Dec 20, 2018
    Posts:
    22
    This is excellent. I'm just wondering, is there a way to set a point's transform as a GameObject's transform? That way, the path constantly updates to follow a moving GameObject's transform.
     
  10. Linsky

    Linsky

    Joined:
    Mar 27, 2017
    Posts:
    1
    Is there a way to make the object to stop at a certain point and keep going after a key is pressed?
     
  11. meuklight

    meuklight

    Joined:
    Feb 2, 2016
    Posts:
    10
    Very nice and useful asset! Thank you so much!
    Can I create a Bezier Curve and Vertex Curve once and only update the points position other time?
     
  12. unity_VMhu5_JGYBnyOg

    unity_VMhu5_JGYBnyOg

    Joined:
    Jan 4, 2020
    Posts:
    1
    Hello, thank you very much, it is very nice and useful. I have a question with creating path by script, can I update the path? and how can i do that (with script)
     
  13. Fimiam

    Fimiam

    Joined:
    Oct 24, 2016
    Posts:
    7
    Hello, it's really awesome tool!
    Can anyone share a script to align two bezier paths with each other and smooth angles?
     
  14. hhamedware

    hhamedware

    Joined:
    Feb 8, 2019
    Posts:
    3
    hi,
    thanks for this path SebastianLague,
    but i want to know is there way to deactivate and activate this path when i need it or change the path to another path by script.
    thank you.
     
  15. starfoxy

    starfoxy

    Joined:
    Apr 24, 2016
    Posts:
    71
    Does anyone know how can I tell if my transform has reached the end of it's movement along an open path?

    I have tried all sorts of ways (that didn't work) but I was sure there is probably a simple conditional or callback that can be used.

    I am using (from the documentation) the following in my Update routine:

    Code (CSharp):
    1. if (pathCreator != null){
    2.             distanceTravelled += speed * Time.deltaTime;
    3.             transform.position = pathCreator.path.GetPointAtDistance(distanceTravelled, endOfPathInstruction);
    4.         }

    This all works perfectly but I would like to know when my transform has reached the end of the path. Anyone have an idea what I should be doing?
     
  16. Aseemy

    Aseemy

    Joined:
    Aug 22, 2015
    Posts:
    144

    Just check if the distance traveled is greater than the total length of the path.

    Code (CSharp):
    1. void Update()
    2.         {
    3.             if (pathCreator != null)
    4.             {
    5.                 distanceTravelled += speed * Time.deltaTime;
    6.                 transform.position = pathCreator.path.GetPointAtDistance(distanceTravelled, endOfPathInstruction);
    7.                 if(distanceTravelled>=pathCreator.path.length)
    8.                 {
    9.                     //reached end
    10.                 }
    11.             }
    12.         }
     
    Last edited: May 26, 2020 at 9:34 AM
  17. starfoxy

    starfoxy

    Joined:
    Apr 24, 2016
    Posts:
    71
    Thank you @Aseemy ! That works perfectly. Simple and elegant. :)
     
unityunity