コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        if (began)
        {
            Vector3 direction = targetPosition.position - transform.position;


            spotlight.MoveTowards(direction.XZ(), speed);

            if (direction.XZ().magnitude < 0.1f)
            {
                NewPosition();
            }
        }
    }