fixed: various movement and air control fixes and tweaks, various clean up
This commit is contained in:
@@ -3,16 +3,13 @@ using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
using Reset.Player.Movement;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions {
|
||||
|
||||
[Category("Reset/Movement")]
|
||||
public class CalculateAirMovement : ActionTask<Transform>{
|
||||
public BBParameter<Vector3> airMoveDirection;
|
||||
public BBParameter<Vector3> groundMoveDirection;
|
||||
public BBParameter<Vector3> groundMoveDirection; // Unused on 7/29/25, delete if still unusued later
|
||||
|
||||
public BBParameter<PlayerFacingDirection> playerFacingDirection;
|
||||
|
||||
private float airControlPower = 1f;
|
||||
|
||||
//Use for initialization. This is called only once in the lifetime of the task.
|
||||
@@ -25,7 +22,7 @@ namespace NodeCanvas.Tasks.Actions {
|
||||
//Call EndAction() to mark the action as finished, either in success or failure.
|
||||
//EndAction can be called from anywhere.
|
||||
protected override void OnExecute(){
|
||||
|
||||
airControlPower = 1f;
|
||||
}
|
||||
|
||||
//Called once per frame while the action is active.
|
||||
@@ -34,7 +31,7 @@ namespace NodeCanvas.Tasks.Actions {
|
||||
airMoveDirection.value = Vector3.Lerp(airMoveDirection.value, Vector3.zero, .7f * Time.deltaTime);
|
||||
|
||||
// Decay Air Control power
|
||||
airControlPower = Mathf.Lerp(airControlPower, 0f, 3f * Time.deltaTime);
|
||||
airControlPower = Mathf.Lerp(airControlPower, 0f, 2f * Time.deltaTime);
|
||||
|
||||
// Add air control
|
||||
Vector3 inputVector3 = new(agent.GetComponent<PlayerControls>().rawMoveInput.x, 0f, agent.GetComponent<PlayerControls>().rawMoveInput.y);
|
||||
@@ -47,7 +44,7 @@ namespace NodeCanvas.Tasks.Actions {
|
||||
|
||||
//Called when the task is disabled.
|
||||
protected override void OnStop() {
|
||||
groundMoveDirection.value = agent.GetComponent<CharacterController>().velocity;
|
||||
// groundMoveDirection.value = agent.GetComponent<CharacterController>().velocity;
|
||||
EndAction(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user