敵が特定のポイントをランダムワープする

アニメーションからワープ実行
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemyWarp : MonoBehaviour
{
public Vector2[] warpPoints;
// 必ず「public」にすること(重要)
public void Warp()
{
int num = Random.Range(0, warpPoints.Length);
transform.position = warpPoints[num];
}
}





【2022版】ActionGame2D(全33回)
他のコースを見る
アニメーションからワープ実行
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemyWarp : MonoBehaviour
{
public Vector2[] warpPoints;
// 必ず「public」にすること(重要)
public void Warp()
{
int num = Random.Range(0, warpPoints.Length);
transform.position = warpPoints[num];
}
}





敵が特定のポイントをランダムワープする