Results 1 to 1 of 1
  1. #1
    OBrozz's Avatar
    Join Date
    May 2011
    Gender
    male
    Posts
    819
    Reputation
    65
    Thanks
    813

    Unity3D Bullet Code

    Code:
    using UnityEngine;
    using System.Collections;
    
    public class Bullet : MonoBehaviour 
    {
    	public float Damage = 10;
    	public float Speed = 1500;
    	public PlayerController Player;
    	
    	void Start()
    	{
                    // Bullet Drop like in bfbc2
    		rigidbody.AddRelativeForce(new Vector3(0,0,Speed), ForceMode.Impulse);
    		Destroy(gameObject, 5f);
    	}
    	void OnCollisionEnter(Collision col)
    	{
    		col.gameObject.SendMessageUpwards("RecieveDamage", Damage, SendMessageOptions.DontRequireReceiver);
    		Destroy(gameObject);
    	}
    }

  2. The Following User Says Thank You to OBrozz For This Useful Post:

    cruciimperio (01-09-2012)

Similar Threads

  1. Need Code for Special Bullet...
    By GoDZeN in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 2
    Last Post: 02-21-2011, 08:10 AM
  2. What is the normal bullet code?
    By idiot2010 in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 1
    Last Post: 11-29-2010, 03:41 PM
  3. [Solved]Aimbot code "ONE THAT DON'T SPAWN BULLETS IN THEIR HEAD"
    By ~Just IN~ in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 5
    Last Post: 10-31-2010, 04:36 AM
  4. [Solved]explosive bullets code
    By Muskratus in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 6
    Last Post: 10-02-2010, 05:58 PM
  5. a Couple WPE Weapon codes?
    By phil823 in forum WarRock - International Hacks
    Replies: 16
    Last Post: 02-10-2006, 02:14 PM