I’m making a 2d top down shooter like Galaga. I want the projectile to shoot from the ship and move up the screen with a sine wave pattern. This is all I got and I’m only able to move the projectile straight
public class Projectile : MonoBehaviour {
// Used to control how fast the game object moves
public float MoveSpeed = 5.0f;
// Use this for initialization
void Start () {
DestroyObject(gameObject, 1.0f);
}
// Update is called once per frame
void Update () {
transform.position +=
transform.up * Time.deltaTime * MoveSpeed;
}
}