Created
September 19, 2018 00:40
-
-
Save nabesi777/7f0fd6544971c9f3cdb857d28e7419f3 to your computer and use it in GitHub Desktop.
BulletMover C# unity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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