daily pastebin goal
7%
SHARE
TWEET

Untitled

a guest Jan 20th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Paddle : MonoBehaviour {
  5.  
  6.     // Use this for initialization
  7.     void Start () {
  8.    
  9.     }
  10.    
  11.     // Update is called once per frame
  12.     void Update () {
  13.     Vector3 paddlePos = new Vector3 (0.5f, this.transform.position.y , 0f);
  14.     float mousePosInBlocks = Input.mousePosition.x / Screen.width*16;
  15.     paddlePos.x = Mathf.Clamp (mousePosInBlocks, 0.5f, 22f);
  16.     this.transform.position = paddlePos;
  17.     }
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top