Change playercontroller to fixed dt and change starting scene #269
|
@ -1,4 +1,4 @@
|
|||
Start in Fullscreen: false
|
||||
Starting Scene ID: 94246101
|
||||
Starting Scene ID: 97158628
|
||||
Window Size: {x: 1920, y: 1080}
|
||||
Window Title: SHADE Engine
|
|
@ -315,13 +315,13 @@ public class PlayerController : Script
|
|||
{
|
||||
Quaternion currentRotation = tranform.LocalRotation;
|
||||
Quaternion targetRotation = Quaternion.LookRotation(new Vector3(axisMove.x, 0.0f, axisMove.y), new Vector3(0.0f, 1.0f, 0.0f));
|
||||
tranform.LocalRotation = Quaternion.Slerp(currentRotation, targetRotation, rotationFactorPerFrame * (float)Time.DeltaTime);
|
||||
tranform.LocalRotation = Quaternion.Slerp(currentRotation, targetRotation, rotationFactorPerFrame * (float)Time.FixedDeltaTime);
|
||||
}
|
||||
else if (camArm && tranform && isAiming)
|
||||
{
|
||||
Quaternion currentRotation = tranform.LocalRotation;
|
||||
Quaternion targetRotation = Quaternion.Euler(0.0f, SHADE.Math.DegreesToRadians(camArm.Yaw + 180.0f), 0.0f);
|
||||
tranform.LocalRotation = Quaternion.Slerp(currentRotation, targetRotation, rotationFactorPerFrame * (float)Time.DeltaTime);
|
||||
tranform.LocalRotation = Quaternion.Slerp(currentRotation, targetRotation, rotationFactorPerFrame * (float)Time.FixedDeltaTime);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -346,14 +346,14 @@ public class PlayerController : Script
|
|||
else if (currentState == RaccoonStates.FALLING)
|
||||
{
|
||||
float prevYVel = v.y;
|
||||
float newYVel = v.y + (gravity * fallMultipler * (float)Time.DeltaTime);
|
||||
float newYVel = v.y + (gravity * fallMultipler * (float)Time.FixedDeltaTime);
|
||||
float nextYVel = (prevYVel + newYVel) * 0.5f;
|
||||
v.y = nextYVel;
|
||||
}
|
||||
else
|
||||
{
|
||||
float prevYVel = v.y;
|
||||
float newYVel = v.y + (gravity * (float)Time.DeltaTime);
|
||||
float newYVel = v.y + (gravity * (float)Time.FixedDeltaTime);
|
||||
float nextYVel = (prevYVel + newYVel) * 0.5f;
|
||||
v.y = nextYVel;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue