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