hello i was wondering if there was a way to attach a object to the fps camera like a flashlight so it goes where you look. does anybody know how to do that?
Just set the flashlight’s parent to the camera. You can either do it in the editor by placing the flashlight GameObject under the camera, or at runtime like this:
<In Flashlight Script>
transform.parent = Camera.main.transform;
Then just rotate it to make sure that it’s facing whichever way you would like it to face and any changes to the parent’s transform will also affect the flashlight (or whatever else you place under the camera).
@Jake O’Connor is right here Parenting the objects is a Good Choice…