rj-action-library/Runtime/Interactions/CharacterController/Gravity.cs

24 lines
457 B
C#
Raw Normal View History

2025-01-03 12:09:23 +00:00
using Godot;
using System.Collections;
using System.Collections.Generic;
using Godot.Collections;
namespace Rokojori
{
[GlobalClass]
public partial class Gravity:CharacterControllerAction
{
[Export]
public float strength = 10;
2025-01-08 18:46:17 +00:00
protected override void _OnTrigger()
2025-01-03 12:09:23 +00:00
{
if ( body.IsOnFloor() )
{
return;
}
// RJLog.Log( controller.body.Velocity );
AddVelocity( Vector3.Down * strength );
}
}
}