24 lines
454 B
C#
24 lines
454 B
C#
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;
|
|
|
|
public override void _OnTrigger()
|
|
{
|
|
if ( body.IsOnFloor() )
|
|
{
|
|
return;
|
|
}
|
|
// RJLog.Log( controller.body.Velocity );
|
|
AddVelocity( Vector3.Down * strength );
|
|
}
|
|
}
|
|
} |