Rotational force produces choppy results

I am currently working on a space simulator where I have gravity set to 0. To move the player, I am using AddForce() on the relevant axis for linear motion. This works/looks fine in-game. Similarly, I am using AddRelativeTorque() for rotation about an axis. While this is working, it is much choppier in-game than the linear force movements. I am using ForceMode.Force for application of both forces.

I should also note, this is a VR application. However, frame rate is steady at 90 fps even when the rotation is choppy.

Any suggestions to improve the rotational performance?

Thanks.

Are you adding force in FixedUpdate?

Yes, all of my physics-based calls are in FixedUpdate. One thing I’ve noticed is that when moving laterally (i.e. strafing), objects in the scene are moving less relative to the player when compared to rotating so I’m wondering if it’s choppier simply because the objects are being moved much further per frame when spinning compared to strafing? Still, the performance difference is concerning and I’m hoping it can be improved.

Thanks.

I’m not an expert but i might be able to help if i you post the code

Appreciate it. The code is really simple. All I am doing is setting a bunch of boolean values based on the user input and using them to control the physics calls in FixedUpdate.

    void FixedUpdate()
    {
        if (thrusting)
        {
            rb.AddForce(rb.transform.forward * (moveForward ? linearForce : -linearForce));
        }

        if (climbing)
        {
            rb.AddForce(rb.transform.up * (moveUp ? linearForce : -linearForce));
        }
      
        if (rotating)
        {
            rb.AddRelativeTorque(Vector3.up * (turnRight ? rotationalForce : -rotationalForce));
        }
    }

As mentioned, everything works but it’s the ‘rotating’ bit that is very janky.

Hm, everything seems fine to me. What you might want to check is:
1). Is your rigidbody set to interpolate?
2). Is your angular drag set to default? (0.05f)
3). Print out your (rotating) boolean to ensure that it is of value that you are expecting it to be.
4). You could also try to change relativeTorque to just Torque and replace Vector3.up with rb.transform.up for consistency.

All good suggestions, but unfortunately no luck. Tried all 3 interpolation settings as well as adjusting the angular drag including no drag. The booleans are all producing expected values and there was no discernible difference between AddRelativeTorque and AddTorque.

I do have a suspicion the issue may be with my VR headset as when viewing the game in the Unity editor, everything looks nice and smooth. The only problem I have with that explanation is that when I play Elite Dangerous in VR, which has the same kind of motion, it is nice and smooth and that game is certainly pushing things much harder than my simple app is. As part of my debugging, I lowered my game object count to a single cube and even that did not help.

what version of Unity?

2020.3.12f