Guest User

Untitled

a guest
Jan 23rd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. // speed at which audio clip plays at its original pitch:
  2. var audioClipSpeed = 10.0;
  3. var imp:float;
  4. //var bulle:Transform;
  5. var whosyoudaddy:GameObject;
  6. function Start() {}
  7. function Update() {
  8. var p = rigidbody.velocity.magnitude / audioClipSpeed;
  9. audio.pitch = Mathf.Clamp( p, 0.01, 4.0); // p is clamped to sane values
  10. imp= rigidbody.velocity.magnitude*rigidbody.mass;
  11. }
  12. function OnCollisionEnter(collision : Collision) {
  13. if (collision.gameObject.tag == "monster")
  14. {
  15. var bulle = whosyoudaddy.GetComponent.<GenericGunS>();
  16. bulle.xp++;
  17.  
  18. }
  19.  
  20. }
Add Comment
Please, Sign In to add comment