r2mods/ilspy_dump/ror2_csproj/RoR2/AntiGravityForce.cs

18 lines
393 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using UnityEngine;
namespace RoR2;
[RequireComponent(typeof(Rigidbody))]
public class AntiGravityForce : MonoBehaviour
{
public Rigidbody rb;
[Tooltip("How much to oppose gravity. A value of 1 means it is unaffected by gravity.")]
public float antiGravityCoefficient;
private void FixedUpdate()
{
rb.AddForce(-Physics.gravity * antiGravityCoefficient, ForceMode.Acceleration);
}
}