Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Convert from unity 2021 to 2022
#3
(19-03-2023, 06:17 PM)josemendez Wrote: Hi!

You can use CopyFromNBC from the Unity.Collections.NotBurstCompatible namespace, since CopyFrom has been removed in the latest Collections package version:
https://docs.unity3d.com/Packages/com.un...sions.html

kind regards,

one more thing:


private void UpdateKinematicVelocities(float stepTime)
{
//TODO this freezes unity FPS, so I commented out, lot of WARNINGS
/*
    // differentiate positions/orientations to get our own velocites for kinematic objects.
    // when calling Physics.Simulate, MovePosition/Rotation do not work correctly. Also useful for animations.
    if (unityRigidbody.isKinematic)
    {
        // differentiate positions to obtain linear velocity:
        unityRigidbody.velocity = (transform.position - prevPosition) / stepTime;

        // differentiate rotations to obtain angular velocity:
        var delta = transform.rotation * Quaternion.Inverse(prevRotation);
        unityRigidbody.angularVelocity = new Vector3(delta.x, delta.y, delta.z) * 2.0f / stepTime;
    }*/

    prevPosition = transform.position;
    prevRotation = transform.rotation;
}




unity 2022 throw a lot of warnings (like you can't update the velocity on a kinematic body), and FPS goes to 15-30 FPS in the editor from 80-90


so I had to comment that out. Is it okay? Or I need this one?
Reply


Messages In This Thread
Convert from unity 2021 to 2022 - by lacasrac - 19-03-2023, 05:06 PM
RE: Convert from unity 2021 to 2022 - by lacasrac - 21-03-2023, 09:03 AM
RE: Convert from unity 2021 to 2022 - by lacasrac - 29-03-2023, 07:12 AM
RE: Convert from unity 2021 to 2022 - by lacasrac - 29-03-2023, 12:49 PM
RE: Convert from unity 2021 to 2022 - by lacasrac - 29-03-2023, 01:38 PM
RE: Convert from unity 2021 to 2022 - by lacasrac - 04-04-2023, 09:53 AM