Getting Started
1. Install the required plugin
In order to remove and load files on disk, we need functions that are not exposed to blueprint by default. To get access to those functions (which are used by this asset) navigate to the Plugins Window, search for “Blueprint File Utilities” and enable it. After that, you will be prompted to restart the engine.
2. Setup Input Mappings
To use the camera, you’ll first need to set up your input actions. You can either add the input actions manually inside Settings->Project Settings ->Input or copy/paste the input mappings below into your project’s DefaultInput.ini file.
Project Settings Input Setup
DefaultInput.ini Input Code
+ActionMappings=(ActionName="Jump",Key=SpaceBar,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="Jump",Key=Gamepad_FaceButton_Bottom,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="Jump",Key=MotionController_Left_Trigger,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="Jump",Key=MotionController_Right_Trigger,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="SetCamera",Key=G,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="ShootPhoto",Key=LeftMouseButton,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="Gallery",Key=P,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="GalleryNextPage",Key=Gamepad_RightShoulder,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="GalleryPrevPage",Key=Gamepad_LeftShoulder,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="GalleryNextPage",Key=Right,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="GalleryPrevPage",Key=Left,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="Crouch",Key=LeftControl,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="ShootPhoto",Key=Gamepad_RightTrigger,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="Gallery",Key=Gamepad_Special_Left,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="GalleryNextPage",Key=MouseScrollUp,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="GalleryPrevPage",Key=MouseScrollDown,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="Crouch",Key=Gamepad_FaceButton_Right,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="SetCamera",Key=Gamepad_LeftTrigger,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="ZoomIn",Key=MouseScrollUp,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="ZoomOut",Key=MouseScrollDown,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="ZoomIn",Key=Gamepad_DPad_Up,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="ZoomOut",Key=Gamepad_DPad_Down,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="ToggleCameraFlash",Key=F,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="ToggleCameraFlash",Key=Gamepad_FaceButton_Top,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
3. Set up Animations
The plugin contains an already set up example character blueprint. To use your own character, first retarget the provided animations inside the “InstantCameraAnimations” folder to your characters skeleton. Of course, you can also create your own animations using the provided ones as reference. Open your player’s animation blueprint and add the following nodes to your state machine, so the just retargeted animation montage can be accessed.
4. Skeleton Sockets
Open your character’s skeleton and add the following sockets (make sure you have named them the same as listed below:
1. PictureSocket – add this socket to the thumb of the hand that will grab the picture.
2. CameraSocket_Print – Add this socket to your characters right hand bone. Add the camera as preview mesh and select the print photo animation as preview and transform the new socket to make it fit the camera.
3. CameraSocket_Hold – Also add this socket to the right hand-bone. Then, as you did before, add the preview mesh and select the camera set animation as preview and adjust the socket transform.
5. Character Blueprint
Next, open your player character’s blueprint and add BP_InstantCameraComponent as child actor to it. You can drag and drop it there, or just click on the Add Component button and choose it from the list. Copy the blue commented nodes from the example character blueprint (BP_Player) to your own character blueprint and add missing variables by right-click -> create variable.
You will probably have to delete “Crouch” & “Uncrouch” and add the nodes again manually if it’s marked red.
6. Camera Settings
Once everything is set up properly, you can open BP_InstantCameraSettings and change the settings you find in there if you want.