change: finished and cleaned all settings changes, code commented, smoothing and easing are now exponential

This commit is contained in:
Chris
2025-09-26 14:03:11 -04:00
parent bd2903a0b2
commit 4569cea664
20 changed files with 676 additions and 399 deletions

View File

@@ -69,7 +69,7 @@ namespace NodeCanvas.Tasks.Actions {
directionOnStart = agent.transform.position.DirectionTo(grapplePoint.value);
// Get the current move direction
velocityOnStart = agent.outputMoveDirection;
// velocityOnStart = agent.outputMoveDirection; // NOTE: Deprecated by new movement values
// For setting finalDirection's initial value, first compose the swing variables one-time
Vector3 velocityWhenMoving = CalculateSwingDirections(Vector3.Distance(agent.transform.position, grapplePoint.value), directionOnStart);
@@ -86,7 +86,7 @@ namespace NodeCanvas.Tasks.Actions {
//Called once per frame while the action is active.
protected override void OnUpdate(){
agent.outputMoveDirection = Vector3.MoveTowards(agent.outputMoveDirection, Vector3.zero, .5f);
// agent.outputMoveDirection = Vector3.MoveTowards(agent.outputMoveDirection, Vector3.zero, .5f); // NOTE: Deprecated by new movement values
// Basic variables, direction to point and current distnace
Vector3 directionToPoint = agent.transform.position.DirectionTo(grapplePoint.value);
@@ -178,7 +178,7 @@ namespace NodeCanvas.Tasks.Actions {
gizmoFinalDirection = finalDirection;
// Finalize the movement to the controller
agent.SetNewDirection(Vector3.Lerp(agent.additionalMoveDirection, finalDirection.Flatten(null, 0), 1f * Time.deltaTime));
// agent.SetNewDirection(Vector3.Lerp(agent.additionalMoveDirection, finalDirection.Flatten(null, 0), 1f * Time.deltaTime)); // NOTE: Deprecated by new movement values
agent.SetNewGravity(finalDirection.y);
agent.SmoothToSpeed(speed, 25f * Time.deltaTime);