I’m trying to use a camera shake for a headbob by setting the camera shake oscillation duration to -1 (indefinite) then calling it on keypress with ClientStartCameraShake, then stopping it with ClientStopCameraShake.
It works, but ClientStopCameraShake doesn’t seem to use the Oscillation Blend Out settings inside the Camera shake asset, so when the player stops moving the camera simply snaps back to its default position.
I want it to blend smoothly back to position, how can I do this?
I don’t know about that stopping it clean, but a possible solution could be to make a camera bounce that is just 1 shake, and then put it on a looping timer. When you want it to stop just clear the timer and the last shake will play out and finish smoothly.
Here’s what you can do:
1: Update your project to UE4.12.5 (There is a boolean value in the stop camera shake that can be toggled to make it end smoothly.)
2: Make your camera shake last about half a second long (with fade in and out times of about 0.15 seconds) and create this blue print. I found this to be a very good solution.
Sorry If this response was too late-I had this problem for so long in my project. I can’t believe I finally solved it though.
I’m using Unreal Engine 5.1 with an Wave Oscilator Camera Shake Pattern, but i think this will work just fine on Unreal Engine 4, i’ve had this problem before and it’s really simple what you can do, for a headbob you dont need all of that indefinite Camera Shake oscillation duration.
Here is what i did:
Go to the camera shake Blueprint Class and on the top of everything there is a Boolean “Single Instance” so turn that on.
Then below the Frequency of every Vector you have the Initial Offset Type (If you are on Unreal Engine 4 it will appear only as Initial Offset) and for default it’s set on “Random” (EOD Offset Random if you’re on Unreal Engine 4) you will want to switch that for “Zero” (again EOD Offset Zero if you’re on Unreal Engine 4)
If you dont have any Blend in Time or Blend out Time you will want to change that for something like 0.2 or 0.5 dont forget to change the Oscillation duration to 1 again
If you want differet Camera Shakes for different walking types like Running or when the player stops, you can do this by stopping all the Instances of the other Camera Shakes and starting the other.
Like if you want a Running camera shake just after verifying if the players its moving verify if the speed its greater than the normal walking speed with a branch if its true then you are running so stop all the instances of the Walking Camera Shake and start the Running Camera Shake.