Creating a mouse controller cuases UE to crash?
So originally what I did was this:
And that didn't work because it permanently screwed up my project folder.
I just presumed that this was an incorrect way of doing it, so next I tried to follow this tutorial, and it did what it said it would do, which was cool, except I also needed to work with the mouse after, so I created C++ version of the blueprint file they got us to make in the tutorial and it looked like this:
And then when I placed the code to try and use it in my pawn cpp file:
(I did have the correct include in the code) and then it did the exact same thing!
I think this is a problem on UE side now, can anyone please help me out here? Thanks
asked Dec 14 '15 at 03:21 AM in Bug Reports
Sorry for my late response. I found a way to get it to work, but I'm not sure if it's elegant or not. The problem I was having was that I wanted to use the DeprojectMousePositionToWorld() function but was unable to set up an APlayerController* variable in the way I described in the first 2 lines of my question. I'm still not entirely sure what the problem was, but my best guess is that the constructor method for my pawn class is executed before the controller file in initilialised, or something like that. Anyway, I solved the problem by instantiating my APlayerController* variable under the BenginPlay() function instead of the constructor. Now I have a new problem of spawning an actor causes UE to crash. So many crashes :/ Aww well. I'll figure this one out.
Follow this question
Once you sign in you will be able to subscribe for any updates here