Answer the question
In order to leave comments, you need to log in
Why is my unity2d character not moving?
The character does not respond to movements, although the code was written, and also gives the following error:
Here is the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour
{
Rigidbody2D rb;
public float speed;
// Start is called before the first frame update
void Start()
{
rb = GetComponent<Rigidbody2D>();
}
// Update is called once per frame
void Update()
{
}
void FixedUpdate()
{
rb.velocity = new Vector2(Input.GetAxis("Horrizontal") * speed, rb.velocity.y);
}
}
Answer the question
In order to leave comments, you need to log in
No need to produce questions. Although this one is formatted according to the rules, so...
You don't have the axes set up. To set up the axes - in the Edit->Settings->Input unit (it's in the menu).
But in general - it seems that there is a horizontal axis by default - it only remains to write it correctly - you have a typo in the word Horrizontal - it should contain one r.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question