blob: cc8b92e408cc08444aad5c4bc4d73ab9ffca203e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
using System;
using UnityEngine;
using Random = UnityEngine.Random;
public class RandomSpawnPosition : MonoBehaviour
{
public float range = 3;
private void Start()
{
var x = Random.Range(-range, range);
var z = Random.Range(-range, range);
transform.position = new Vector3(x,transform.position.y,z);
}
}
|