movement does not work

my movement with the following script does not work ):

Edit: I restarted unity and now it works for some reason…

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour
{
    public float speed = 5f;

    private float moveinput;

    private Rigidbody2D rb;

    private bool RechtsSchauen = true;

    private void Start()
    {
        rb = GetComponent<Rigidbody2D>();
    }

    // Update is called once per frame
    void FixedUpdate()
    {
        moveinput = Input.GetAxis("Horizontal");
        Debug.Log(moveinput);
        rb.velocity = new Vector2(moveinput * speed, rb.velocity.y);


        if (RechtsSchauen == false && moveinput > 0)
        {
            Flip();
        }
        else if (RechtsSchauen == true && moveinput < 0)
        {
            Flip();
        }

    }

    void Flip()
    {
        RechtsSchauen = !RechtsSchauen;
        Vector3 scaler = transform.localScale;
        scaler.x *= -1;
        transform.localScale = scaler;
    }
}

does it print that moveinput value and its correct?
Have you tried adding more speed?

yes it prints the movement but not correct
i also tried diffrent speed values

@FireJojoBoy

BTW fix your post to use code tags, so it is easier for everyone to read… and you most like get more answers too.

thanks for the tipp :smile: