Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class walk2 : MonoBehaviour {
- // Use this for initialization
- void Start () { }
- void Update () {
- float move = 1.00f;
- for ( int i = 0 ; i < 10 ; i++){
- transform.position = new Vector2 (transform.position.x + move, transform.position.y);
- }
- for ( int j = 0 ; j < 10 ; j++ ){
- transform.position = new Vector2(transform.position.x - move, transform.position.y);
- }
- }
- }
- private float move = 0.1f;
- void Update() {
- if (transform.position.x < 10) {
- transform.position = new Vector2 (transform.position.x + move, transform.position.y);
- } else {
- transform.position = new Vector2 (transform.position.x - move, transform.position.y);
- }
- }
- transform.position = Vector2.Lerp(starting_vector, target_vector, Time.deltaTime);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement