I want the light to turn to the left when I touch the (A) key and to turn to the right when I touch the (D) key.
I have the light horizontally, not vertical like this normally
I use the light (SpotLight) as a flashlight
I am using unity 2d
I want the light to turn to the left when I touch the (A) key and to turn to the right when I touch the (D) key.
I have the light horizontally, not vertical like this normally
I use the light (SpotLight) as a flashlight
I am using unity 2d
@jafethjuegos Hey put this together. It works just needs some improvement. Hopefully it
will at least give you an idea of how to do it
public Light l = new Light();
void Start()
{
l.type = LightType.Spot;
}
// Update is called once per frame
void Update()
{
if (Input.GetKey(KeyCode.A))
{
l.transform.eulerAngles += Vector3.right * Time.deltaTime * 100;
}
if (Input.GetKey(KeyCode.D))
{
l.transform.eulerAngles += Vector3.left * Time.deltaTime * 100;
}
}