UE 4.8.2 crashing on a blueprint compile with a C++ function

I have this really weird issue with C++ and Blueprints. So what happens is i have a PlayerController and in the PlayerController i have a C++ function that is suppose to rotate the camera that is attached to the character which the controller is controlling. How it work is when the rotate camera function is called it goes into the Character and call its own rotate camera function, but it doesn’t. When i make a blueprint class of my PlayerController and i call rotate camera from it, it freezes when i compile the blueprint, and i have to manually shutdown UE4. SO here are some things i discovered:


  • If i call the rotate camera function in the Character class from the PlayerController Blueprint class, i just cast the get pawn in blueprint as my Character, it works, so i know there is nothing wrong with the code.

  • I also have another C++ function in the Controller that fires the Character’s weapon and it works in the same manner. When called it will call the FireWeapon function on the Character. In blueprint this works fine.


Controller.h

UFUNCTION(BlueprintCallable, Category = StuffICanDo)
void RotatePlayerCamera(float deltaYaw);

UFUNCTION(BlueprintCallable, Category = StuffICanDo)
void FireWeapon();

Controller.cpp

void Controller::RotatePlayerCamera(float deltaYaw)
{
PlayerCharacter->RotateCamera(deltaYaw);
}//<----THIS FREEZES AT COMPILE IN BLUEPRINT

void Controller::FireWeapon()
{
PlayerCharacter->FireWeapon(GetMouseHit());
}//<-----THIS WORKS


I can’t figure out why this is? Should I just update my project to 4.10? Would my models and other assets i got from the store become incompatible? It was the sole reason from me using 4.8.


EDIT: I forgot to mention, FireWeapon is called in blueprint when a mouse press event happens, and RotatePlayerCamera is called in EventTick (For Testing Purposes)

Found a work-around. I slapped a boolean to enable the rotation and in the Event Tick i check if its true. If it is it will rotate the camera. I dont know why it works this way, but it works.


To clarify the solution, for anyone else having this same issue, I made a boolean that allows me to rotate the camera. In the Tick Event i check to see if that boolean is true, if it is I rotate the camera to whatever amount.


You may closed this ticket.