Home Unreal Engine

measure length of spline

greentooth
Offline / Send Message
C86G greentooth
Hello : )

I need to find out how long a (landscape) spline is that I made in Unreal. Google and the Unreal documentatioj say there is a "Get Spline Length" function, but I cannot figure out how to use it.

https://docs.unrealengine.com/en-US/BlueprintAPI/Spline/GetSplineLength/index.html

As always, any help appreciated!

Replies

  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Get a reference to the landscape spline. Get the spline component from it, and hook it up to the get length node. It will output the length of the spline in centimeters.
  • C86G
    Options
    Offline / Send Message
    C86G greentooth
    I... I fail at every part of your sentence.

    Googeling how to get a reference only raises more question marks above my head and that´s only the start : (
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Okay I wanted to make you a series of screenshots about how to do it, and it turns out that this is not possible.Because you can't access the landscape splines in blueprints. They are not accessible, because they don't even appear at the world outliner. It seems like even the class is hidden. The landmass plugin could possibly help here, but I'm not sure. Its also definitely possible to access it in c++, but I guess thats not really an option here.
  • C86G
    Options
    Offline / Send Message
    C86G greentooth
    The workaround would be to recreate the landscape splines with a normal spline and then do what you suggested. Stil, I have no clue how to do that : D
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Yep, that would work.
    This is how you do it:
    1.Make a new blueprint, inherit it from actor...
    2.Add a spline component to it.
    3. Make a new function (I called it get length)
    4. Put the logic in the function
    5. Make the function being callable inside the editor, by selecting its input pin, and enabling "call in editor" on the right panel
    6. Place the actor in the level and set up the spline
    7. You will see that the blueprint has a new button on the details, with the function name on it (get length). If you press the button, the function will be called and you get the spline length


  • C86G
    Options
    Offline / Send Message
    C86G greentooth
    Awesome, thanks a lot! Will try later!


    : )
  • C86G
    Options
    Offline / Send Message
    C86G greentooth
    That works!

    Man, you´re the man! Thanks : )
Sign In or Register to comment.