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:
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?
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?