Post by tharindu on Mar 14, 2017 13:39:52 GMT
Hey guys,
With Timeline release looming overhead times are starting to get exciting. Cinemachine Virtual Cameras will play a huge part in getting cutscenes and everything done but Cinemachine recommends an ENTIRELY Cinemachine setup to drive your cameras.
How does this help us as Invector users to not mess up our v3rdPersonCamera objects ?
I asked the same in the Cinemachine forum and thankfully Adam Myhill's response was good enough for me to get a working solution. Also it's a simple one
NOTE : These are not Cinemachine 1.5 beta you find on the forum thread . This is the assetstore Cinemachine version.
Follow these steps.
1. Create the Cinemachine runtime from the Cinemachine dropdown.
2. Create a virtual camera, give it a meaningful name like say 'CM_TPCam' and nest the object inside the Camera object in the project hierarchy that has the v3rdPersonCamera script.
3. Go to the Cinemachine_Autogen*** object in the project hierarchy and set the Camera object as the default camera.
That's it
Follow the instructions below to create a simple fly by to the player between two cinemachine cameras.
1. Go to the virtual camera we created (CM_TPCam) and assign it's priority to 2.
2. Create an empty object in the project hierarchy, move it to a place from where you want to on the map. Create a new CinemachineVirtualCamera and nest it within the new object. Call the new virtual camera CM_Fly.
3. Make sure the new Virtual Camera's priority is 1. (Usually priority 1 is assigned on Create)
4. Go to the cinemachine runtime object and create new blender settings.
5. Once done, create an entry in the blends array by setting the count to 1.
6. Set the 'blend from' camera to CM_Fly and the 'blend to' camera to CM_TPCam.
7. Open the blend curve. The blend curve's X axis is for time. Set the curve to come to Y coordinate 1.0 at around 10 X coordinates. This means the blend will take 10 seconds.
8. Normalize the curves in case you set the curve over 1.0 Y axis.
9. Run the game.
10. In inspector mode, disable the CM_Fly camera and you'll see a nice fly by effect which will blend into our 3rd person camera.
You can improve upon the approach above by making a script that will run on awake which disables the virtual camera during on loading the scene.
I would also recommend you edit the v3rdPersonCamera class's update method by setting lockCamera to true when the Cinemachine camera is blending.
The property is Cinemachine.CinemachineCoreAccess.CoreInstance.IsBlending if I am right. Sorry for not giving any screenshots or uploading a video on this. I am not a game developer by profession so it's been really hard to find time to post something
Also note that we are not using a single Cinemachine feature like Noise or Transposer or Composer here. With these features added we could get a very realistic camera while leveraging both power of cinemachine and flexibility of invector camera states.
Here's a video clip of what I managed to do
drive.google.com/open?id=0B5maePrnUb2-M00wRmprRnAtQm8
Have fun and let me know what your Cinemachine experiences are. Would love to have a crowd here that heavily uses Cinemachine when Timeline is good to go.
With Timeline release looming overhead times are starting to get exciting. Cinemachine Virtual Cameras will play a huge part in getting cutscenes and everything done but Cinemachine recommends an ENTIRELY Cinemachine setup to drive your cameras.
How does this help us as Invector users to not mess up our v3rdPersonCamera objects ?
I asked the same in the Cinemachine forum and thankfully Adam Myhill's response was good enough for me to get a working solution. Also it's a simple one
NOTE : These are not Cinemachine 1.5 beta you find on the forum thread . This is the assetstore Cinemachine version.
Follow these steps.
1. Create the Cinemachine runtime from the Cinemachine dropdown.
2. Create a virtual camera, give it a meaningful name like say 'CM_TPCam' and nest the object inside the Camera object in the project hierarchy that has the v3rdPersonCamera script.
3. Go to the Cinemachine_Autogen*** object in the project hierarchy and set the Camera object as the default camera.
That's it
Follow the instructions below to create a simple fly by to the player between two cinemachine cameras.
1. Go to the virtual camera we created (CM_TPCam) and assign it's priority to 2.
2. Create an empty object in the project hierarchy, move it to a place from where you want to on the map. Create a new CinemachineVirtualCamera and nest it within the new object. Call the new virtual camera CM_Fly.
3. Make sure the new Virtual Camera's priority is 1. (Usually priority 1 is assigned on Create)
4. Go to the cinemachine runtime object and create new blender settings.
5. Once done, create an entry in the blends array by setting the count to 1.
6. Set the 'blend from' camera to CM_Fly and the 'blend to' camera to CM_TPCam.
7. Open the blend curve. The blend curve's X axis is for time. Set the curve to come to Y coordinate 1.0 at around 10 X coordinates. This means the blend will take 10 seconds.
8. Normalize the curves in case you set the curve over 1.0 Y axis.
9. Run the game.
10. In inspector mode, disable the CM_Fly camera and you'll see a nice fly by effect which will blend into our 3rd person camera.
You can improve upon the approach above by making a script that will run on awake which disables the virtual camera during on loading the scene.
I would also recommend you edit the v3rdPersonCamera class's update method by setting lockCamera to true when the Cinemachine camera is blending.
The property is Cinemachine.CinemachineCoreAccess.CoreInstance.IsBlending if I am right. Sorry for not giving any screenshots or uploading a video on this. I am not a game developer by profession so it's been really hard to find time to post something
Also note that we are not using a single Cinemachine feature like Noise or Transposer or Composer here. With these features added we could get a very realistic camera while leveraging both power of cinemachine and flexibility of invector camera states.
Here's a video clip of what I managed to do
drive.google.com/open?id=0B5maePrnUb2-M00wRmprRnAtQm8
Have fun and let me know what your Cinemachine experiences are. Would love to have a crowd here that heavily uses Cinemachine when Timeline is good to go.