Is there a way to use the camera shake that also effects all objects attached to the Player Camera?
I’m using a Client Play Camera Shake inside a sub level, attached to the player controller. Using Play Space: Camera Local. The camera shakes, but the attached Components do not shake with it. I tried inside the character blueprint and still had the same results.
This is also using the FPS Template.
1 Like
I also struggled with this issue, and finally got it working as follows - I did mine in C++ so not sure of how it would be done in Blueprints though.
Situation before fix:
So, I have a weapon spawned by the PlayerCharacter, and I set its location in the PlayerCharacter’s CalcCamera function. Now, unfortunately the CameraManager applies camera shake AFTER it gets the location of the PlayerCharacter’s eyes (GetActorEyesViewPoint()).
The Fix:
It might be a tad hacky, but instead of setting the Weapon’s location from the PlayerCharacter’s CalcCamera() function, I simply attached the Weapon’s Root Component to the CameraManager’s TransformComponent, as this TransformComponent stores the Camera’s Location INCLUDING the camera shake.
E.g. in my Character:
WeaponLeft = GWorld->SpawnActor<APWNWeapon>(WeaponLeftClass);
// Attach Weapons to the camera manager so camera shakes are taken into account
WeaponLeft->AttachRootComponentTo((Cast<APlayerController>(Controller))->PlayerCameraManager->GetTransformComponent());
Hope this helps.
Thanks staticvoidlol!
The information you provided let me hack my way into making a first prototype and it worked!
I Redid a few things and updated the blueprint. And here it is! Just have this occur during begin play.
3 Likes