Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class Playermovement : MonoBehaviour
- {
- public Rigidbody2D rb;
- public float mspeed = 7;
- public static System.Numerics.Vector2 Normalize;
- Vector2 movement;
- void Update()
- {
- var movement.y = Input.GetAxisRaw("Vertical");
- var movement.x = Input.GetAxisRaw("Horizontal");
- }
- void FixedUpdate()
- {
- rb.MovePosition(rb.position + movement + mspeed * Time.fixedDeltaTime);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement