|
So, I have a clever movement controller that uses rigidbody relative torque and relative force. It works very well, and I am happy with it. The problem, however, is attaching a camera. For the longest time I applied this script to the camera, which carried the player mesh inside its hierarchy. Now, however, I wanted some slack / pull to the camera, so as you turn your character, the camera lets you see the side of your vehicle for a moment before it snaps behind you. So, I decided on a configurable joint. I've finally gotten the joint to what seems like good parameters, however, the biggest problem in this situation seems to be the rigidbody values of mass and drag, as well as to an extent, my speed/force multipliers in my movement controller. Now I have the player character and main camera separate, with the joint on the player, and the camera as its 'connected body.' I've looked up the docs, and interpolation exacerbates the issue.
(comments are locked)
|
|
One time I noticed camera jerkiness because the camera's transform was being updated in the Update function and I'd forgotten to multiply it by Time.deltaTime. Placing it in a FixedUpdate function also worked. It could be something having to do with the way physics calculations are updated. Maybe rather than make the camera a part of the joint system you could try:
or maybe put that transform sync in a LateUpdate() function. Just shooting in the dark, let me know if it works! Actually, all my force code that affects movement of the vehicle is in the FixedUpdate function. In fact, everything worked fine up until the point where I added the configurable joint. Maybe I should make this more clear.
Feb 13 '10 at 06:03 PM
CryptoQuick
(comments are locked)
|
|
If all else fails, lower the Fixed Timestep in Edit->Project Settings->Time.
(comments are locked)
|

Just to be clear, folks, this is most likely related to the configurable joint being added to the moving vehicle. It's also got to relate to mass and drag, because I noticed this also changes how things work.