|
|
|
|
|
|
var rotate = Mathf.Clamp(vectorAction[2], -1f, 1f) * m_InvertMult; |
|
|
|
|
|
|
|
var upward = 0.0f; |
|
|
|
if (moveY > 0.0 && transform.position.y - transform.parent.transform.position.y < 0f) |
|
|
|
if (moveY > 0.0 && transform.position.y - transform.parent.transform.position.y < -1.5f) |
|
|
|
//m_AgentRb.AddForce(new Vector3(moveX * 20f, upward * 10f, 0f), ForceMode.VelocityChange);
|
|
|
|
Quaternion deltaRotation = Quaternion.Euler(zAxis * rotateZ);// * .5f);
|
|
|
|
Quaternion deltaRotation = Quaternion.Euler(zAxis * rotateZ * .5f); |
|
|
|
m_AgentRb.MoveRotation(m_AgentRb.rotation * deltaRotation); |
|
|
|
//gameObject.transform.Rotate(0f, 0f, rotateZ);
|
|
|
|
|
|
|
|
|
|
|
transform.position.z); |
|
|
|
} |
|
|
|
var rgV = m_AgentRb.velocity; |
|
|
|
m_AgentRb.velocity = new Vector3(Mathf.Clamp(rgV.x, -20, 20), Mathf.Min(rgV.y, 20f), rgV.z); |
|
|
|
m_AgentRb.velocity = new Vector3(Mathf.Clamp(rgV.x, -20, 20), Mathf.Min(rgV.y, 10f), rgV.z); |
|
|
|
|
|
|
|
// energy usage penalty cumulant
|
|
|
|
energyPenalty += -0.001f * (Mathf.Abs(moveX) + upward); |
|
|
|