Example #1
0
    // 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>();
    }
Example #2
0
// 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>();
    }
Example #3
0
    // 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);
    }
Example #4
0
    // 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);
    }