1
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Lightbug.CharacterControllerPro.Demo
|
||||
{
|
||||
|
||||
public class AddTorque2D : AddTorque
|
||||
{
|
||||
new Rigidbody2D rigidbody = null;
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
|
||||
rigidbody = GetComponent<Rigidbody2D>();
|
||||
}
|
||||
|
||||
protected override void AddTorqueToRigidbody()
|
||||
{
|
||||
rigidbody.AddTorque(torque.z);
|
||||
rigidbody.angularVelocity = Mathf.Clamp(rigidbody.angularVelocity, -maxAngularVelocity, maxAngularVelocity);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user