How do i make a flashlight?

Hello. In the past two days ive tried all sorts of stuff to make a object follow the player while moving. Like a Spotlight. Im trying to get a flashlight. I try to put a Spotlight on the map, and ive tried all sorts of stuff to make it keep following the player, or be “Attached” To the player

Anybody that can be able to help?

Hello Zuaxis,

Easiest way I can think of would be to do it in your Character Blueprint under the Components Tab as seen in the attached image:

Just create a Spot Light Component and set the parameters as you wish and attach it to your Character Mesh. Might be a little more involved for doing something in third person with a character holding a flashlight, but this is how I would do it for an FPS.

-W

I do now have one more question. As i now place this on the map. I cant move, and im not looking from the perspective of the camera. Im looking somewhere else. No movement

Hey Zuaxis,

Try doing this:

  1. Create a New Blueprint First Person project.
  2. In the Blueprint Folder, open up MyCharacter.
  3. On the Components tab, select Add Component and choose Spotlight.
  4. Left Click (forgive me, not right-click) SpotLight and drag it and drop it on "Mesh1p" which is under FirstPersonCamera.
  5. Click on your Spotlight and move it up a bit in the viewport so it’s near the camera.
  6. Compile then play in the editor.

You should be able to see it in the darker areas of the map and it should move along with the camera.

-W

1 Like