Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class a : MonoBehaviour {
- Vector3 temp;
- float halfW;
- float halfH;
- void Start () {
- Debug.Log(Screen.width);
- Debug.Log(Screen.height);
- }
- // Update is called once per frame
- void Update () {
- //temp.x+=0.2f;
- //temp.y += 0.2f;
- //temp.z += 0.6f;
- //temp.x = Input.mousePosition.x;
- //Debug.Log(Input.mousePosition.x);
- //transform.position = temp;
- halfW = Screen.width/4;
- halfH = Screen.height/4;
- transform.position = new Vector3((Input.mousePosition.x-halfW)/halfW, 0,(Input.mousePosition.y-halfH));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement