Performance issues...think I narrowed it down

Hey guys I am having a bit of issue here.
My game runs fine on an iPhone 4, constant 30 FPS.
On an iPhone 3G my game runs poorly.

We only have about 15 draw calls and 3.5k polygons on screen.

When just coasting we get 28-30FPS like the iPhone 4.
But when I try to shoot (by swiping up or down) the FPS drops to about 10-15. (sometimes lower). On the iPhone 4 it drops the FPS by 1 or 2 and is not noticeable. Inside the Unity editor it drops about 25fps (from 160 to
135)
I THINK we narrowed it down to this code here. Which is responsible for swiping, and shooting out objects.

Any one have any suggestions on what could be causing the problem?
I posted both my scripts below relating to the issue.

<ShootObject.JS> This code attaches to the player

#pragma strict
#pragma downcast
var object : Rigidbody;
var speed = 10.0;

var moved = false;
var endPosition :Vector2;
var startPosition :Vector2;


function FireObject (direction:int) {
	var objectClone : Rigidbody = Instantiate(object, transform.position, transform.rotation);
	objectClone.transform.parent = Camera.main.transform;
	objectClone.velocity = Vector3.forward * speed * direction;
	// You can also acccess other components / scripts of the clone
	//objectClone.GetComponent(MyRocketScript).DoSomething();
}

// Calls the fire method when holding down ctrl or mouse
function Update () {
	
	//keyboard controls
	if (Input.GetButtonDown("Fire2")) {
		FireObject(-1);
	}
	//keyboard controls
	if (Input.GetButtonDown("Fire1")) {
		FireObject(1);
	}
	//checks to see if its paused so that it doesn't shoot while paused
	if (Camera.main.GetComponent.<PauseMenu>().paused == false){
		for (var i = 0; i < Input.touchCount; i++) {
			var touch = Input.GetTouch(i);
			//get the position when touched the screen
			if (touch.phase == TouchPhase.Began) 
			startPosition = touch.position;

			//check the position when playerer stops touching the screen
			if (touch.phase == TouchPhase.Ended){
				endPosition = touch.position;
				//calculate the length of the swipe
				var flickLength = (startPosition.y) - (endPosition.y);
				if (flickLength < -5)
				//shoot the object up
				FireObject(1);
				if (flickLength > 5)
				//shoot the object down
				FireObject(-1);	  
			}
			
		}
	}
	
	

}

<objectproperties.js>And this code attaches to the projectile (a cube in our case)

#pragma strict
//var isPresent :boolean = false;
//var isHouse :boolean = false;
var angularSpeed = 50;
var missHouse : GameObject;


function LateUpdate () {
	rigidbody.AddTorque (Vector3.right * angularSpeed);
} 
function OnBecameInvisible () {
	Camera.main.GetComponent.<Score>().score -= 500 ;
	Camera.main.GetComponent.<Score>().inARow = 0;
	DestroyObject(gameObject);
	missHouse = GameObject.Find("Miss");
	if (missHouse != null  missHouse.active)
	missHouse.audio.Play();
}

Any help would be appreciated.
Thanks!

Creating instances on the fly will impact your framerate, as will destroying them. Try creating a cache of bullets/missiles and re-using them . move them somewhere safe when they’re not in action, rather than destroying them outright.

Here’s some basic tips:

  1. Instiating is slow. Make a pool of objects and just set their active = true when needed instead
  2. GetComponent<> on every frame is also slow. Cache the component in Start()
  3. Same thing with rigidbody.*, cache the rigidbody component

Thanks, these suggestions made it much better!