예제 #1
0
    void Shoot(Vector2 towards)
    {
        //maak nieuwe kogel
        GameObject tempkogel = (GameObject)Instantiate(bullet.gameObject, Gunpoint.transform.position, Quaternion.identity);
        //reken de hoek uit
        float angle = VectorMath.CartesianToPolar(towards).x;

        //draai de kogel
        tempkogel.transform.eulerAngles = new Vector3(0, 0, angle);
    }