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)