using UnityEngine;
using System.Collections;
public class BulletBarth : MonoBehaviour {
public GameObject Bullet;
//private Vector3 Player;
//private GameObject PlayerVV;
// Use this for initialization
void Start ()
{
//PlayerVV = GameObject.Find("Player");
}
// Update is called once per frame
void Update ()
{
//Player = PlayerVV.transform.position;
if (Input.GetKeyDown(KeyCode.Z)) { Instantiate(Bullet); } }
}
初心者じみた質問ですみません。よろしくお願いいたします。
今、Unityでゲーム制作をしていて、PlayerのpositionからBulletをインスタンスしたいと考えているのですが、上手く行かず手詰まっています。
コメントアウトしている部分は、BulletBarth がPlayerのpositionを取得できるように組んだつもりだったんですが、インスタンスされる場所が変わらなかったので、コメントアウトさせておきました。
よろしくお願いいたします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/07/30 08:26
2015/07/30 08:35
2015/07/30 08:53
2015/07/31 02:53