Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can Curve Spline be used for an in game level editor.
#26
(05-05-2023, 10:25 PM)Lupos Wrote: I've made an attempt to make my own generator. Likely due to my novice experience with this asset and its api, but I did end up needing to do a considerable amount of copying from existing modules and editors.

I was sorta able to make it work by doing the following

1) customize Spline Input to generate an array of segments (instead of an entire spline)
2) customize Spline Rasterizer to take the multiple inputs and rasterize them into the usable data
3) customize Volume Spots to take the multiple segments and generate data, then apply a custom unit offset (based off the original range param) to offset.

It sorta seems to be working however I'm having trouble getting closed to work, its likely due to how I've tried implementing this. I also still get the error in relation to StartCP/EndCP as I told you before.

If possible, would you mind taking a look? I'd love a fix to why I can't seem to make it close. It's related to try to send the end/start points as a segment (and the distance ending up calculating negative.

But I'm also just curious if this is even the best way, is there an easier way to do this without needing all these modules? Maybe a way to just modify the volume spots module to only generate within a segment (without feeding it custom new segments?)

I'm pretty stumped haha, but I'm happy I was able to get as far as I did. Learned a lot in the process.

Good job Lupos Smile
I attached a modified version of your scene where things are working (assuming you apply the fix I posted above on your code)
To be completely honest, I don't have time right now to dive into your code and give advise. You should know in a couple of days what is keeping me so busy these days. I will try to check your code ASAP. But until then I did a simple work around in the scene I attached, that does not need looking into your code:
If your code works well on open splines, but not on closed ones, then why not just use open splines ;D I modified your scene so that the spline is open, but set it up so that it looks exactly as a closed spline. I did that by adding a last cp at the same position as the first one, and applying the Bezier handles of the closed spline CPs into the open spline CPs.

I hope today's posts helped you.
Have a great day.


Attached Files
.unity   Scene2.unity (Size: 43.81 KB / Downloads: 0)
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Messages In This Thread
RE: Can Curve Spline be used for an in game level editor. - by _Aka_ - 05-08-2023, 11:01 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 3 11 04-02-2024, 02:24 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_

Forum Jump: