在Unity Board游戏中的阵列路径上按顺序移动播放器

时间:2015-10-22 05:50:28

标签: unity3d

我有Transform []数组我希望在数组上的每个点上逐个移动Player 。现在我根据Dice Value使用Vector3.MoveTowards但是它根据Dice直接移动到新位置

    void FixedUpdate () 
{

    if (currentpoint<points1.Length) {
        Player.transform.position = Vector3.MoveTowards (Player.transform.position, points1 [currentpoint].position,Time.deltaTime * 2f);

            }
}

对于递增整数变量当前点我正在使用

    public void movePlayer ()
{   

   currentpoint += DIceValue;

}

我有一个圆形路径所以它根据diceValue直接移动到新路径。

0 个答案:

没有答案
相关问题