Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Movement : MonoBehaviour
- {
- public float speed;
- private Vector2 movVel;
- private Rigidbody2D rb;
- public float upSpeed;
- private void Start()
- {
- rb = GetComponent<Rigidbody2D>();
- }
- void Update()
- {
- Vector2 mov = new Vector2(Input.GetAxisRaw("Horizontal"), 0f);
- movVel = mov * speed * Time.deltaTime;
- rb.velocity = Vector2.up * upSpeed * Time.deltaTime;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement