Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VolumeController CrossRelativePosition Very Choppy Movement
#1
Question 
Hi,

I've tried several methods to move a car using VolumeController.CrossRelativePosition but the movement becomes very choppy especially when going around bends.

I recorded a video to demonstrate the problem:



The problem is especially noticeable at times 11s, 22s, 25s of the video.

For the video I used the code in example  21_CGExtrusion to move the car sideways:

Code:
                volumeController.CrossRelativePosition += angularSpeed *
                                                          Mathf.Clamp(
                                                              volumeController.Speed / 10f,
                                                              0.2f,
                                                              1f
                                                          )
                                                          * Input.GetAxis("Mouse X")
                                                          * Time.deltaTime;

It runs inside Update and the VolumeController is set to update in Update. It's almost identical to the example code, except I use Input.GetAxis("Mouse X") directly, since I don't use the y-axis for throttle.

One difference in my setup is that I have the car model directly on the same GameObject as the VolumeController, rather than having the model as a child. This seemed to be necessary after many tests and considering other game requirements. However, I don't see why that could create a problem with sideways movement choppiness.

EDIT: For testing, I copied the "Controller" GameObject, complete with all children, from the 21_CGExtrusion scene to my scene, and the sideways movement is quite smooth. The only difference I can see is that the VolumeController GameObject in my custom setup also contains the model of the car, along with its Collider and Rigidbody. However, I can't understand why that could be a problem.

Is there something I can do to make the sideways movement smooth?
Reply
#2
Hi,

Does the problem happen even if there is no mouse movement?
    If yes, then try smoothing the input of the mouse.
    If no then does this issue happen if you set the Update setting of the controller to Late Update?
        If yes then does this problem happen even after increasing the resolution of the splines and generated meshes involved in your scene?

Please let me know of the answers for these questions.

Have a nice day
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#3
(06-05-2024, 12:46 PM)_Aka_ Wrote: Hi,

Does the problem happen even if there is no mouse movement?
    If yes, then try smoothing the input of the mouse.
    If no then does this issue happen if you set the Update setting of the controller to Late Update?
        If yes then does this problem happen even after increasing the resolution of the splines and generated meshes involved in your scene?

Please let me know of the answers for these questions.

Have a nice day

Hi,

Thank you for your response.

The problem happens also when there is no mouse movement. But I don't understand, why I should "try smoothing the input of the mouse " in case it happens if "even if there is no mouse movement".

Maybe I did not understand your response correctly.

I also tried 0 for the mouse input (instead of Input.GetAxis("Mouse X"))  but no change.

I also tried setting the Update setting of the controller to Late Update but again no change.

However, there's no problem with the Controller GameObject of your example scene.  I copied the "Controller" GameObject, complete with all children, from the 21_CGExtrusion scene to my scene, and the sideways movement is quite smooth Here's a video:



There is some slight choppiness, which is probably due to resolution, but it's so small that it's not really a problem.
I mean, I don't understand why the "Controller" with same code on same spline is OK and with my model it's not.

EDIT 1: I also increased resolution: In the Shape Extrusion module, in both the Path and Cross tabs, I set the Resolution to 100 (was 50), and the Angle Threshold to 5 (was 10). Also, in the Curvy Spline Advanced Settings I set Max Points Per Unit to 100 (was 10). I wasn't sure if setting the Resolution in the Shape Extrusion module would be enough, so I changed all the above, and I tested after each change. However, there was no change at all.

EDIT 2: I removed the Update() from my CarController, so there's no input or processing before assigning the CrossRelativePosition. The VolumeController is set for speed 60, and CrossRelativePosition 0 (Range -0.18 to 0.18). The problem is still there.

So, I concluded that the problem must be in the VolumeController settings. I compared my settings with the example Controller and voila! Direction and Up Damping were set to 0.15. So, I set these values to my VolumeController, and the problem was fixed!
Reply
#4
(06-05-2024, 02:26 PM)pako88 Wrote: The problem happens also when there is no mouse movement. But I don't understand, why I should "try smoothing the input of the mouse " in case it happens if "even if there is no mouse movement".

Sorry, my fault, I mixed the  yes and no cases. I meant that if the problem is due to the mouse inputs, try smoothing the input.

Since you tested everything and did not found the issue, I would like you to send me a reproduction case so I can investigate further. Is this possible?

Thank you
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#5
(06-06-2024, 10:19 AM)_Aka_ Wrote:
(06-05-2024, 02:26 PM)pako88 Wrote: The problem happens also when there is no mouse movement. But I don't understand, why I should "try smoothing the input of the mouse " in case it happens if "even if there is no mouse movement".

Sorry, my fault, I mixed the  yes and no cases. I meant that if the problem is due to the mouse inputs, try smoothing the input.

Since you tested everything and did not found the issue, I would like you to send me a reproduction case so I can investigate further. Is this possible?

Thank you

Hi,

You must have missed the latest edits of my post, where I found the problem: " So, I concluded that the problem must be in the VolumeController settings. I compared my settings with the example Controller and voila! Direction and Up Damping were set to 0.15. So, I set these values to my VolumeController, and the problem was fixed! ".

So, it's working for me now. All is good! Smile
Reply
#6
Indeed, I did the last one.
Glad to know that this wasn't a bug Smile

If and when you feel like it, please leave a review for the asset, that helps a lot.
Have a nice day.
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
  Left-right movement, and spline follow shihaya 3 10 07-12-2024, 12:50 PM
Last Post: _Aka_
  Add noise to spline controller movement DekoGames 2 10 02-06-2024, 01:28 PM
Last Post: DekoGames
  Add VolumeController at runtime dmarqsp 3 7 12-16-2023, 12:12 PM
Last Post: _Aka_
Question Setting instantiated object to spline, then starting movement? _RicO 3 9 06-28-2023, 06:01 PM
Last Post: _Aka_

Forum Jump: