Skip to content

Instantly share code, notes, and snippets.

@nabesi777
Created September 19, 2018 00:40
Show Gist options
  • Save nabesi777/7f0fd6544971c9f3cdb857d28e7419f3 to your computer and use it in GitHub Desktop.
Save nabesi777/7f0fd6544971c9f3cdb857d28e7419f3 to your computer and use it in GitHub Desktop.
BulletMover C# unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BulletMover : MonoBehaviour {
//弾丸のスピード
private int speed = 10;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
//発射される弾丸の向きとスピードです。向きは動画ではfowardとなっていましたが、
//今回は右側へ発射したかったため、rightへ変更しています。
transform.Translate(Vector3.right * Time.deltaTime * speed);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment