My code is ahead:
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Control : MonoBehaviour
{
public GameObject player;
public Rigidbody2D rb2d;
public float runSpeed = 10f;
float horizontalMove = 0f;
private void FunctionForJump()
{
rb2d.AddForce(new Vector2(100f, 0f));
}
void Update() {
horizontalMove = Input.GetAxisRaw("Horizontal") * runSpeed;
}
void FixedUpdate()
{
if (Input.GetKeyDown((KeyCode)32))
{
FunctionForJump();
}
I keep getting these error messages:
and when I press space nothing happens.
I am very confused at what is wrong could anyone help?
edi: I fixed it