How to set river width via blueprint

So I struggled with this for SO SO SO long. Like at least a day. and that isn’t meant to be sarcasm or arrogant. I mean I spent the whole day searching and looking and trying different nodes to get the data. An entire day spent on something like this is a costly thing in the world of content creation.

I realized a bit later that a depth/width/length are just dimensions… aka an actors dimensions, or SCALE!

So if you get a spline point by whatever means, like “get spline point at”, which uses the point’s index number, and then do a ‘break spline point’ node, and use the SCALE output pin to get the River’s depth/width/length at that spline point! The Scale X is the width, the Scale Y is the Height/Depth and Scale Z is always 1 I think since it’s the scale along the river, which is of course calculated from River spline component length divided by # spline points.

Anyway I hope this helps anyone trying to find the depth/width of the River via BP or something. I didn’t technically answer the question yet… because I can’t.

I have tried multiple methods of SETTING the width of the River via BP and nothing updates it. I don’t know if the scale is set by the River class itself and is otherwise Read only, or if I am missing something. Good luck. Sorry I haven’t looked at the C++ class yet for it to see if there is even a public SET method for the scale. Maybe it is only private and the width/depth need to be set a different way.

2 Likes

Hey there @BKC_Labs! You’re correct with how you would edit the scale in editor, but the system isn’t meant to be adjusted at runtime, so the landscape brushes and similar effects won’t scale with the river itself even if you were to reach in and scale the spline itself.

Sorry to necro an old thread, but for any poor soul looking to solve this in the future and not waste lots of time (like I did as well as the prior comments), here’s the answer.

The key (and what most, including me) probably get wrong is you can’t access River Width OR Depth from the River Spline or the Water Body Component (but strangely it does allow you to get/set Velocity and Audio Intensity - which feels really inconsistent).

Inconsistency aside, you MUST cast your Water Body Component to the more specific WaterBodyRiverComponent. Then you can absolutely Set River Width and Depth. See screenshot.