So I was coding a multishot projectile in the form of a 2d missile. Ideally I want two missiles side by side to fire forward on the plane. I have not yet saved the code because I noticed there would be a parsing error (newObjRight and +=). I would like to know if anyone has any ideas on how to solve this. Also I believe the error is only in the Projectile2 script and not anywhere else. Thanks ahead of time!
using UnityEngine;
using System.Collections;
public class Projectile2 : MonoBehaviour {
// Used to control how fast the game object moves
public float MoveSpeed = 7.0f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
transform.position +=
transform.up * Time.deltaTime * MoveSpeed;
}
public void FireMultiShotSideBySide();
{
//Right
Projectile2 newObjRight = Instantiate (Projectile2, transform.position, transform.rotation) as Projectile2
newObjRight.transform.position += newObjRight.transorm.right * 1.0f
//Left
Projectile2 newObjLeft = Instantiate (Projectile2, transform.position, transform.rotation) as Projectile2
newObjLeft.transform.position += newObjLeft.transorm.left * 1.0f
}
}