Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        //transform.position = Vector3.MoveTowards(transform.position, positions[index].position, moveSpeed * Time.deltaTime);

        if (Input.GetKeyDown(KeyCode.Mouse0))
        {
            InvokeRepeating("Move", 0, moveTime);
            fpsCounter.Initialize();
        }

        if (index < positions.Length)
        {
            transform.rotation = Quaternion.RotateTowards(transform.rotation, positions[index].rotation, rotateSpeed * Time.deltaTime);
        }
    }