Esempio n. 1
0
    // - On collision enter -
    void OnCollisionEnter(Collision col)
    {
        Vector3[] collisionLocalRelativeVel = PLDir.ConvertToLocalVelocities(col.relativeVelocity);

        //Debug.Log((collisionLocalRelativeVel[1].magnitude));

        // TODO: improve crippled stun
        if (collisionLocalRelativeVel[1].magnitude > 3)
        {
            Debug.Log(" CRIPPLED - " + collisionLocalRelativeVel[1].magnitude);
            audio.CrippleSound();
            Stun(3);
            Character.RigidBody.AddTorque(PLDir.forward * -30f + PLDir.right * 40f, ForceMode.Impulse);
        }
    }