You need to tell your blueprint just which camera it should be affecting; in this instance, the player character that's already been set up. You can do this via the Client Play node that you can then feed into the target of your Camera Shake blueprint. Simple, yet effective.
- [Instructor] As we are ready to get underway and start creating our timeline, the first step we want to take is to tell our game who and or what the timeline is meant to be affecting. Which we will do by using the client play node, and then tie that into our camera shake blueprint. To begin then, inside our content browser, let's double click to enter the BP_FPS_Character Plan Blueprint. This is the sample file's blueprint that, as you can see, controls all of the player character's movement, and, as we want to add motion to our character's camera as they walk, well, we know that we're in the right place.
After finding some empty space, let's right click, and start to type the word player in the search field. Now, in the list that appears, we want to locate and then select the player controller option, and then add this to our blueprint graph. We need to call or get the player controller because this is the camera that we will need to apply our headbutt motion to. What we need to do now is connect the camera shake effect and the player controller together, and so, let's click and drag on the output of our player controller node and type the word client into the search field that appears.
Again, from the filtered list, we then need to locate, and obviously select, the client play camera shake option. With our new camera shake node added to the graph, we then want to specify just which camera shake we want it to connect to, which in this case is the camera motion blueprint that we set up earlier. So to do that, let's click to expand the select class dropdown, and choose the camera motion blueprint from the list.
Now, as this has caught me out quite a few times, well, more times than I would like to admit, a word of warning here, always remember to select the new camera shake blueprint as the one that you want to be played. So, make sure to check here first if your effect does not work when testing at the end of the course, as it really is an easily forgotten step. What this will do is tell the node which settings we want to apply when we finally execute the camera shake command. We're not done quite yet, though, as we currently have no way of actually driving the on/off state for the camera motion, which is why we will go ahead and tackle that step in the next video.
- Setting up the camera shake blueprint
- Working with timelines and blueprints
- Creating a timeline, track, and keyframe
- Connecting the timeline
- Finalizing the effect