Why has my spotlight stopped working?

For a while I had my project in 4.11, but recently, I transferred it to 4.20 (After loading into a few versions in between). Unfortunately, the spotlight component of a flashlight I’d created (Which worked in earlier versions) now, for reasons I don’t know, doesn’t work i.e. Doesn’t turn on when I press “F” to activate the flashlight.

What’s confusing is, it only doesn’t work when I pick it up. When it’s on the floor, the spotlight works.

My inventory recognizes that it’s there (It hadn’t for a little while. It kept saying “Accessed none while trying to read Inventory”, which I fixed when I changed the name of my inventory array – I’m assuming newer versions don’t like variables, even of different types, sharing names), so, I don’t think it’s that.

I’ve tried setting the light to be on automatically: No change.

I’ve fixed the deprecated “Attach To” nodes: No change.

I’ve fixed the socket name in said “Attach To” nodes (I think I might have had the socket name wrong): No change.

I’ve fixed another “Accessed none” error by renaming the flashlight mesh which appears in the player’s hand after picking it up: No change.

I’ve changed the “Auto Receive Input” on my flashlight from “disabled” to “player 0” and “player 1” (Just for good measure), thinking that might have had something to do with it: No change.

Even now, as I test it, I get no error messages back. Does anyone know what my problem might be?

First you must give a reference to your inventory before use it. you got that error for something like this

and when you change a name in unreal sometimes Reference to that old name won’t change and you got an error for this. you better check All Blueprint and compile them once again. And if you have a reference to that name replace it with a new one

I got it! Because I created a flashlight skeletal mesh for my 1st person character (Which only appears once the player has picked the flashlight up) I bypassed my event dispatcher and simply had the 1st person character blueprint control toggling the light. Thank you, though! I probably wouldn’t have thought of it otherwise.