Range-based for requires begin function

Hi everbody. I’m trying to loop thru overlapping actors with range based for like in the lecture video. However, there seems to be this error in for statement: “this range-based ‘for’ statement requires a suitable ‘begin’ function and none was found”. I tried googling but haven’t been able to fix it yet.

image

Can anyone explain this?

Thanks!

I had the exact same problem. It should still compile and run. The way I fixed it this was to delete all temporary files and rebuild them from scratch like demonstrated in Lecture 81:
Resetting Your Unreal Project.

Alternatively, I’ve read online that switching the drop down on the VS toolbar from “Development Editor” to “Development” and back will reload UE4 Macros. Don’t have this problem anymore so, I can’t test it.

P.P.S. You need your .generated.h #includes to be the last include. That’s the source of common problems.

1 Like

It helped, thanks!

Privacy & Terms