using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
Rigidbody2D rb2d;
[SerializeField] float torqueAmount =1f ;
// Start is called before the first frame update
void Start()
{
Debug.Log("Get Component");
rb2d = GetComponent<Rigidbody2D>();
}
// Update is called once per frame
void Update()
{
if(Input.GetKey(KeyCode.LeftArrow)) // Input.GetKey(KeyCode.LeftArrow)
{
Debug.Log("Hello");
rb2d.AddTorque(torqueAmount);
}
}
}
When changing to true I can prove the update method is running, but having the input.getKey I don’t get any return when pressing the left key.
Unity Version
2021.1.23f1 Personal