mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 09:54:28 -05:00
-created a script for breakable objects
-updated block prefabs (updated size/added breakable script) -added demo scene for blocks/breakable script
This commit is contained in:
@@ -41,7 +41,6 @@ public class KickController : NetworkBehaviour
|
||||
}
|
||||
//otherwise do ground kick for .3 seconds
|
||||
else if (( Input.GetKeyDown(KeyCode.F) || Input.GetAxis("Kick") != 0) && isKicking == false){
|
||||
Debug.Log("kick");
|
||||
StartCoroutine(Kicking(.3f));
|
||||
}
|
||||
|
||||
@@ -75,6 +74,9 @@ public class KickController : NetworkBehaviour
|
||||
Debug.Log(direction);
|
||||
collision.rigidbody.AddForce(direction * pStats.KickPow, ForceMode.Impulse);
|
||||
}
|
||||
if (collision.transform.CompareTag("destroyable") && myCollider == leg.GetComponent<Collider>()){
|
||||
collision.rigidbody.gameObject.GetComponent<BreakableBlock>().damage(pStats.KickPow);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user