Yes, you're right. The position for the "attached" object is easy, but the direction was the problem. I think I've fixed that now.
You can find my attempt in the attached file in this post. The light position isn't quite right yet so I disabled the shadows but you can make your own adjustments if you want to.
1. Unzip the XML file in your Prefabs folder.
2. In your level, open the prefab library called custom_playerflashlight.xml
3. Place it anywhere inside the level.
4. Extract all the components.
5. Link the playerFlashLight and playerFlashLightFill lights to the playerFlashLightProxy tagpoint.
6. Play the game. The key "k" activates/deactivates the flashlight
-Haven't checked yet, but I think it works only inside the editor for now ^^u
-If your level is outdoors you will need to enclose it using invisible solids. Otherwise when you look at the sky the raycast won't hit anything and the flashlight won't update its direction, looking weird / wrong.