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


Messages In This Thread
VolumeController CrossRelativePosition Very Choppy Movement - by pako88 - 06-04-2024, 02:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Smile Simple splines movement shills 3 3,167 02-26-2025, 09:40 AM
Last Post: _Aka_
  Left-right movement, and spline follow shihaya 3 2,465 07-12-2024, 12:50 PM
Last Post: _Aka_
  Add noise to spline controller movement DekoGames 2 2,024 02-06-2024, 01:28 PM
Last Post: DekoGames
  Add VolumeController at runtime dmarqsp 3 2,262 12-16-2023, 12:12 PM
Last Post: _Aka_

Forum Jump: