1
Fork 0
mirror of https://github.com/Steffo99/beat-td.git synced 2024-11-30 18:54:19 +00:00
beat-td/Assets/Scripts/PositionFromMouse.cs

12 lines
346 B
C#
Raw Normal View History

2018-04-21 09:40:20 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PositionFromMouse : MonoBehaviour {
void Update () {
Vector3 worldPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
transform.position = new Vector3(worldPosition.x, worldPosition.y, transform.position.z);
}
}