using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Controller : MonoBehaviour
{
public float speed = 4f;
public float jumpForce = 11f;
Rigidbody2D rb;
void Start()
{
rb.GetComponent<Rigidbody2D>();
}
void Update()
{
}
private void FixedUpdate()
{
transform.Translate(Vector2.right * speed * Time.fixedDeltaTime);
if (Input.GetKeyDown(KeyCode.Space))
rb.velocity = Vector2.up * jumpForce;
}
}