r2mods/ilspy_dump/ror2_csproj/SetAngularVelocity.cs

21 lines
418 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
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);
}
}