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.
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.
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.
06-06-2023, 06:38 AM (This post was last modified: 06-06-2023, 06:46 AM by hawken.)
(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.
06-06-2023, 09:47 AM (This post was last modified: 06-06-2023, 09:48 AM by _Aka_.)
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.