Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hello! How do I get objects to scale with Slline?
#1
Please forgive me for my English is not very skilled, I will use Google Translate to write articles..
請原諒我的英文不是很熟練,我將使用Google翻譯來編寫文章..。

Hello! How do I get objects to scale with spline?
哈囉!我要如何讓物件隨著spline進行縮放?

I hope that the yellow sphere of Annex 1 will gradually increase in proportion as the spline approaches the end.
我希望將附件1的黃色圓球,在越spline接近結束時,縮放比例逐漸增加。

Just like the effect of Attachment 2.
就像附件2的效果一樣。

Which parameter of the Generator script is to be modified, or how to write the script.
請問要修改 Generator 腳本的哪個參數,或著要如何撰寫腳本。

Finally, I want to know if I can make a flickering effect, and I don't have to do it like a video.
https://www.youtube.com/watch?v=X6H-H76xZU8
最後我想知道可不可以製作閃爍的效果,不用做到像影片這樣輪流閃爍。

Thanks for reading this article, I hope to answer my question.
感謝閱讀這篇文章,希望可以解答我的問題


Attached Files Thumbnail(s)
       
Reply
#2
[attachment=239][attachment=239]I use a very clumsy way to control zoom and flash,
我使用一個很笨的方法來控制縮放及閃爍..。

I am a Unity beginner and can't write very deep scripts...
我是個Unity初學者,沒辦法編寫很深入的腳本..。

There is a misspelled word in the script, please forgive me..
腳本中有拼錯字,請原諒我..

Although it has achieved the effect I want, it is difficult to control.
雖然已經達到我要的效果,但是難以控制。


Attached Files Thumbnail(s)
           
Reply
#3
I modified the script, originally I used the multiplier method and changed to use the added method.
我又修改的腳本,原本我是使用乘數的方法,又改為使用增加的方法。

This method better controls the size of the object.
此方式更好控制物件的大小。

And change the flash time to turn flash.
並且將閃時間更改為輪流閃。

I have successfully achieved the effect I want, but is there a better way?
已經成功達到我要的效果,但是有更好的方法嗎?


Attached Files Thumbnail(s)
           
Reply
#4
Hi,
You code does what you needed to do. Of course there are always different ways to do a task, and depending on the context and your priorities, one way could be better than the other. So I will give you here some other ways I see to implement what you needed. You don't have to do it the way I will explain, but just be aware of this possible other way, it might be helpful in the future:

- You can set a script in each sphere to handle its scale, instead of having one that handles the scale of all of them. This per sphere script would look at which distance it is on the spline, and scale itself accordingly. This way the sphere near the start will be small, and the ones near the end will be big, automatically. So if you have to change the layout of the spheres, the scaling will be always correct, no need to change the scaling script
More usefull reading:
https://curvyeditor.com/documentation/splines/start#units
https://api.curvyeditor.com/520/class_fluffy_underware_1_1_curvy_1_1_curvy_spline.html#a4cdbbc267e3f040d7780ed984b191486
https://api.curvyeditor.com/520/class_fluffy_underware_1_1_curvy_1_1_curvy_spline.html#a6b4c1dbad9994ae36b2971b0fb50293a

- The flickering effect can be done by changing the transparency of the sphere material, through a C# script or even through shaders, instead of disabling the renderer

I hope this helped
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#5
Also, about Curvy, and if it is not done already, take a look at the scripts used in the example scenes, these are valuables resources for learning how to use Curvy
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Line Renderer between two objects on a spline travellinggamedev 1 7 01-13-2024, 10:39 AM
Last Post: _Aka_
  Removing the objects behind an object alms94 6 6 12-06-2023, 09:31 PM
Last Post: _Aka_
  Disable Generator Rasterized Objects SAMYTHEBIGJUICY 3 5 09-01-2023, 03:38 PM
Last Post: _Aka_
  Way to get objects script from generator Lupos 10 29 05-26-2023, 09:51 AM
Last Post: _Aka_

Forum Jump: