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 helps immensely. Thank you.
Available for freelance work—feel free to reach out.
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 helps immensely. Thank you.
Available for freelance work—feel free to reach out.
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 helps immensely. Thank you.
Available for freelance work—feel free to reach out.
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 helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is it possible to make the face at the end of mesh? Chanon 3 12 11-14-2024, 04:38 PM
Last Post: _Aka_
  Can't set CG Path Controller j95677 4 23 10-04-2024, 06:55 PM
Last Post: j95677
  Moving Platform Kokoriko49 8 28 09-23-2024, 09:20 AM
Last Post: _Aka_
  Scene 51: Dynamic track between two points wallflower6 3 13 08-19-2024, 08:18 AM
Last Post: _Aka_

Forum Jump: