Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MoveRight : MonoBehaviour {
- float posX;
- float posY;
- float speed = 0.1f;
- // Use this for initialization
- void Start () {
- posX = transform.position.x;
- posY = transform.position.y;
- }
- // Update is called once per frame
- void Update () {
- transform.position = new Vector3 (posX, posY, 0);
- posX += speed;
- }
Add Comment
Please, Sign In to add comment