// Movement methods private void shoot_at(focus_control cross_hair) { GameObject bullet = Instantiate(Bullet, transform.position + (transform.forward * 1.1f), transform.rotation); bullet.transform.LookAt(cross_hair.transform.position); bullet.AddComponent <BulletControl>(); }
// Movement methods private void shoot_at(focus_control cross_hair) { GameObject bullet = GameObject.CreatePrimitive(PrimitiveType.Sphere); bullet.transform.position = transform.position; bullet.transform.LookAt(cross_hair.transform.position); bullet.AddComponent <projectile_control>(); }
// Start is called before the first frame update void Start() { Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; GameObject Crosshair_GO = Instantiate(CrossHair, transform.position, transform.rotation); cross_hair = Crosshair_GO.AddComponent <focus_control>(); cross_hair.starting_setup(transform); my_camera = Camera.main.GetComponent <CameraControl>(); my_camera.Link(transform, cross_hair.transform); }
// Start is called before the first frame update void Start() { Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; GameObject Crosshair_GO = GameObject.CreatePrimitive(PrimitiveType.Sphere); cross_hair = Crosshair_GO.AddComponent <focus_control>(); cross_hair.starting_setup(transform); my_camera = Camera.main.GetComponent <CameraControl>(); my_camera.Link(transform, cross_hair.transform); }