OnClicked not working in C++(works in bp)

Hi , thanks for your reply. I read your question page and checked my mine. And I updated my description so you can see that there is only one onclicked event and a function to change a boolean in my pawn class. This pawn class is not the one I am controlling and it is just a simple cube. I tried to add it with a box collision and nothing happens.

But the pawn class worked with the blueprint class with or without the box collision. So I am guessing the problem is in the C++ controller side. Like what you said in your problem, there should be some setup that has done by blueprint by default. Maybe just one line of code, but I have no clue what it should be.