Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // speed at which audio clip plays at its original pitch:
- var audioClipSpeed = 10.0;
- var imp:float;
- //var bulle:Transform;
- var whosyoudaddy:GameObject;
- function Start() {}
- function Update() {
- var p = rigidbody.velocity.magnitude / audioClipSpeed;
- audio.pitch = Mathf.Clamp( p, 0.01, 4.0); // p is clamped to sane values
- imp= rigidbody.velocity.magnitude*rigidbody.mass;
- }
- function OnCollisionEnter(collision : Collision) {
- if (collision.gameObject.tag == "monster")
- {
- var bulle = whosyoudaddy.GetComponent.<GenericGunS>();
- bulle.xp++;
- }
- }
Add Comment
Please, Sign In to add comment