r2mods/ilspy_dump/ror2_csproj/SetAngularVelocity.cs

21 lines
418 B
C#

using UnityEngine;
[RequireComponent(typeof(Rigidbody))]
public class SetAngularVelocity : MonoBehaviour
{
public Vector3 angularVelocity;
private Rigidbody rigidBody;
private void Start()
{
rigidBody = GetComponent<Rigidbody>();
}
private void FixedUpdate()
{
rigidBody.maxAngularVelocity = angularVelocity.magnitude;
rigidBody.angularVelocity = base.transform.TransformVector(angularVelocity);
}
}