Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(1 edit)

Alright I put everything in and my code now looks like this (Sorry for being pane in butt I am dummy with barely any C# knowledge)

using UnityEngine;

public class CharacterController : MonoBehaviour
{
    public float MovementSpeed = 1;
    private Rigidbody2D _rigidbody;

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

    private void Update()
    {
        var movement = Input.GetAxis("Horizontal");
        _rigidbody.AddForce(new Vector3(movement, 0, 0) * Time.deltaTime * MovementSpeed);
        transform.Translate(Input.GetAxis("Horizontal") * 15f * Time.deltaTime, 0f, 0f);
        if (Input.GetAxis("Horizontal") < 0)
        {
            transform.rotation *= Quaternion.eulerAngles(0, 0, 10);

        }
        if (Input.GetAxis("Horizontal") > 0)
        {
            transform.rotation *= Quaternion.eulerAngles(0, 0, -10);

        }
        

    }

}

I now get the error Quarternion.eulerAngles cannot be used like a method. Error code CS1955