I am trying to make a movement script, and the erreors are as follow,
(7,26) error CS0501:’ mvement.rigidboby()’ must declare a body , because it is not marked abstract, extern or partial
Here is my code
using UnityEngine;
public class movement : MonoBehaviour
{
public float MovementSpeed = 15f;
RigidBody2d Component.rigidbody();
public float JumpForce = 1f;
private void Start()
{
rigidbody = GetComponent<RigidBody2d>();
}
private void FixedUpdate()
{
var movement = Input.GetAxis("Horizontal");
transform position =+ new vector3(movement , 0,0f) * Time.deltatime * MovementSpeed;
if(Imput.GetButtonDown("Jump") && Mathf.Abs(rigidbody.velocity.y) < 0.001f) {
rigidbody.AddForce(new Vector2(0, JumpForce), ForceMode2D.Impulse);
}
}
}