Connecting a camera and a light so they move together?

Newbie question...

I have a camera with a script and it follows my player gameobject.

The player gameobject moves based on keyboard input so all this is working fine.

I want to attach a light to the camera so the light moves as the camera moves (which of course is moving based on player GO movement).

How do I do this? If I drop the light on the camera it becomes a child object but it does not move with the light

Thanks for any help.

  1. Create an empty GameObject.
  2. Attach your script to this GameObject instead the camera.
  3. Put the camera and the light inside the GameObject you have created.