Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spline Controller Animate - Don't understand the Speed and TimeScale properties
#1
Before I started looking at Animation, I had movement with the Spline Controller working just fine. 

With the Move Mode set as Absolute, I could calculate the Speed as basically my distance / time. 

This is great because I know my distance and how quickly or slowly I want to move, so it all just worked.

Then I wanted to make the movement more realistic with easing (slow down at end, speed up at start etc) so I enabled Animate. Now, I have a Time Scale property which I think is the same as my total time, but I no longer know how to programmatically calculate the Speed because it means something else, speed delta (which I think means acceleration?)

Given that I have a target total movement time and the total distance to travel, how do I go about calculating this new speed, which may have sections with varying speed for easing in and out?
Reply
#2
Hi,
The animate feature is not clear, I am sorry for that. Making it easier to understand is one of the many enhancements on the controllers that are planned for 2.2.5.
Yes, Time Scale is the animation length.
On the Y axis of the Animation,for a specific time you should put (the desired position)/(the Speed value set in the inspector).
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
I updated the doc to make thing better explained
https://curvyeditor.com/documentation/controllers#animate
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#4
(04-23-2018, 09:30 PM)_Aka_ Wrote: I updated the doc to make thing better explained
https://curvyeditor.com/documentation/controllers#animate

Hi Aka, thank you for getting back to me, and for so quickly updating the docs!

Just a clarification - you say here for the Y axis you should put (the desired position)/(the Speed value set in the inspector). But in the documentation in your link it says a distance of y * the absolute value of Speed. Am I misunderstanding or is that a type-o regards divide or multiply?
Reply
#5
(04-24-2018, 08:54 PM)GenericJoe Wrote: Hi Aka, thank you for getting back to me, and for so quickly updating the docs!
You are welcome

(04-24-2018, 08:54 PM)GenericJoe Wrote: Just a clarification - you say here for the Y axis you should put (the desired position)/(the Speed value set in the inspector). But in the documentation in your link it says a distance of y * the absolute value of Speed. Am I misunderstanding or is that a type-o regards divide or multiply?
In the doc it says distance = y * speed
In the post, it says y = distance / speed
It's just two different ways to say the same thing.
The actual difference between the doc and the post is that the latter simplified things by assuming that speed has a positive value (thus confusing speed with absolute value of speed), and that the initial position is 0 (thus confusion the traveled distance with the position).
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#6
Hi Aka, 

The docs say that the Speed is the delta when animated. Could you please give me an example to understand what you mean by delta?

Thank you
Reply
#7
That documentation was written by my predecessor. I modified it just now to make it better explained. Just stick to what is explained in the "Animation" property (the documentation I updated the last time), it should be enough to understand the whole "Animate" thing.
FYI, I am reworking the controllers for the next Curvy update, and removing that confusing double meaning of Speed (depending on the Animate value) is something I am planning to do.
I attached an example scene. It runs an animation of 3 seconds where a cube advances along the spline, slows down, stops, then continues advancing until the end of the spline.


Attached Files
.zip   AnimateExample.zip (Size: 4.23 KB / Downloads: 4)
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#8
I've got it now! You've been a great help.

I think the docs should explicitly say the Y axis also has values between 0 and 1.

It is indeed very misleading using the same speed variable when speed no longer means speed. 

When the Move mode is Relative, it is easy to understand that Speed is actually the Y distance multiplier. 

Thank you
Reply
#9
(05-10-2018, 01:09 AM)GenericJoe Wrote: I think the docs should explicitly say the Y axis also has values between 0 and 1.
Having the Y axis spanning between 0 and 1 makes things easier to understand, but this is not constrained by the code, so stating otherwise in the doc may be misleading for existing users, who have already filled values beyond 1.

(05-10-2018, 01:09 AM)GenericJoe Wrote:
It is indeed very misleading using the same speed variable when speed no longer means speed.
I am against giving two meanings to a variable, even when the said variable is not visible to external coders/users. So I completely agree with you.

Both points you have raised were already present when I started working on Curvy. I definitely want to fix them, and will work on them for the next update, which will be mostly focused on controllers.
Fixing these issues is very easy and straight forward if I didn't care about breaking changes, but when you try to keep the compatibility with older versions, things became very restrictive and difficult.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#10
Hello, I'm sad to see that the animate function is being removed from Curvy, especially after it took me so long to figure out how to use it Sad

To be fair I do understand the reasoning - it's not curvy's responsibility.

My code is all dynamic, as in I create the splines in real-time.
Easing movement along a spline is very common (e.g.start and end slow), and there must be a simple solution via scripts without having to resort to the unity Animation editor window. Can anyone give me some tips?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 1 1 Yesterday, 10:12 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 2 Yesterday, 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_
  GO can't fit end of the spline GameDeveloperek4123 3 13 03-04-2024, 11:06 AM
Last Post: _Aka_

Forum Jump: