Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to make fast moving controller go all the way to linear points?(curvy8)
#1
When using a linear interpolation shape, such as a square, a fast moving spline controller won't move right to the points in the spline. Instead it curves near the point and goes straight again.

Is it possible to make the spline controller move right up to the CP and then change direction when moving at a high speed?

I put a particle emitter on a spline controller and move the spline controller at speed 22 absolute, on a 3x3 rectangle.

   
www.hawkenking.com - interactive design & game development
Reply
#2
I believe what you witnessed is due to your controller using the cache of the spline, while the cache is not dense enough. So interpolating between the cache points leads to diagonal translations near the corners. To solve that, set your controller's Use Cache to false.
Did this work?
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
Hi,

I checked and the controllers "use cache" is already set to false. On or off, it has the same result of skipping the corners.
www.hawkenking.com - interactive design & game development
Reply
#4
Can you send me a reproduction case?
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
(06-03-2023, 09:36 AM)_Aka_ Wrote: Can you send me a reproduction case?

sure, heres a scene, drop this in the Assets root of any project with curvy installed.


Attached Files
.zip   fast corners.unity.zip (Size: 9.23 KB / Downloads: 2)
www.hawkenking.com - interactive design & game development
Reply
#6
Hi
Because of the extremely high speed of your object, the distance travelled between two frames is quite high, and can lead to the controller going over a corner in the time between two frames. A solution is to make the controller update frequently enough. I did that by setting my controller's Update setting to Fixed Update, and setting a very high Physics simulation frame rate (Project settings -> Time -> Fixed timestep). A lower physics frame rate should be enough, but I set a very high one just to make my point very clear.
The above solves whatever issue that can come from the controller. But this is not enough, because part of the issue comes from the particle emitter itself. It does not refresh frequently enough (it is I believe tied to the rendering frame rate, not the physics simulation one). To show you this issue, here is the same simulation, the first one at normal speed, the send slowed down

   
   

Did this help?
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#7
(06-05-2023, 11:18 AM)_Aka_ Wrote: Hi
Because of the extremely high speed of your object, the distance travelled between two frames is quite high, and can lead to the controller going over a corner in the time between two frames. A solution is to make the controller update frequently enough. I did that by setting my controller's Update setting to Fixed Update, and setting a very high Physics simulation frame rate (Project settings -> Time -> Fixed timestep). A lower physics frame rate should be enough, but I set a very high one just to make my point very clear.
The above solves whatever issue that can come from the controller. But this is not enough, because part of the issue comes from the particle emitter itself. It does not refresh frequently enough (it is I believe tied to the rendering frame rate, not the physics simulation one). To show you this issue, here is the same simulation, the first one at normal speed, the send slowed down




Did this help?

I tried this and get the same result, messing with time scale isn't an option here as there are many other game related elements that use time scale. The particles emit while the controller is jumping corners which is shown as the trail so I don't think they are at fault here.

I think I am going to have to code this by hand without a controller.
www.hawkenking.com - interactive design & game development
Reply
#8
About time scale I understand that change it is not an option. I changed it only to show the root of the issue.

A solution using controllers might be to use the On Control Point Reached event to force the controller to not overshoot the CP in one frame. That way you will ensure all frames have their starting position and end position on the same segment. This will avoid the particle emitter going diagonal. This will of course make the controller movement not regular.

In concrete terms, listen to the OnControlPointReached event, and in the listener update the controller position to the desired value and set the Cancel value of the event's argument (instance of CurvySplineMoveEventArgs) to false.

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


Possibly Related Threads…
Thread Author Replies Views Last Post
  Set Volume to the Volume Controller at Runtime pako88 2 10 04-08-2024, 03:26 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_
  Add noise to spline controller movement DekoGames 2 10 02-06-2024, 01:28 PM
Last Post: DekoGames

Forum Jump: