soundvision/UnityProject/Assets/Scenes/Examples/MIDI/script/RandomPosition.cs

15 lines
309 B
C#
Raw Normal View History

2019-10-30 15:02:20 +00:00
using UnityEngine;
namespace cylvester
{
public class RandomPosition : MonoBehaviour
{
public void OnLoopStarted()
{
var x = Random.Range(-3f, 3f);
var y = Random.Range(-3f, 3f);
transform.localPosition = new Vector3(x, y, 0f);
}
}
}