Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- namespace FlingSoccer
- {
- public class InputFollower : MonoBehaviour
- {
- void Start ()
- {
- transform.position = new Vector3 (transform.position.x, 1, transform.position.z);
- }
- void Update ()
- {
- Vector3 point = Camera.main.ScreenToWorldPoint (new Vector3 (Input.mousePosition.x, Input.mousePosition.y, 10));
- transform.position = new Vector3 (point.x, 1, point.z);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment