Cinemachine Integration

..Tom..

New member
I've written a very simply integration with Cinemachine. It's very basic, just setting of priority or targets, but it also defines a SharedVirtualCamera and can be easily expanded upon.

If anyone wants to use it, here it is. Please post any expansions you make as well so the whole community can profit.
 

Attachments

  • CinemachineTarget.cs
    892 bytes · Views: 6
  • CinemachinePriority.cs
    658 bytes · Views: 6
  • SharedVirtualCamera.cs
    311 bytes · Views: 7
Thanks for sharing! I'm really interested in this use case- are you using Behavior Designer for your player-controlled character? Or does this still relate to AI?
 
Both.

I have AI behavior on my NPCs - mostly to make them wander around and doing various errants. I found it works well if they walk from house to house, opening and closing doors, and then simply wait inside for a random time.

I also use Behavior on my Player. My game has a point-to-click logic, so I have a tree on my player character that waits for events (see my other posting) related to clicking on the various hotspots, then sets NavMeshAgent targets on it (mostly using Seek) and further actions depending on the interaction - opening a door to enter somewhere, starting a conversation with an NPC, etc.

It may be easier to script it, but using Behavior Designer makes it easier to debug, and I like to re-use the same system, this way I can re-use Tasks between NPCs and the player.

Essentially, for many things I write Tasks instead of Monobehaviours and then hang them into the tree. I have a task that opens a door, walks through it, then closes it. I have a task that switches between an overhead and a close-up camera. I have a task that sets up the actors for a conversation, then starts that conversation, then tears down things afterwards, and so on.
 
Last edited:
The main Cinemachine use right now is that I switch to an overhead camera when the player is supposed to pick his next action (enter that house, talk to that NPC, examine this place, etc.) and once he's picked something, I change to a Cinemachine ClearShot camera for the cinematics of the player walking/running around the scene, following him as he approaches the target, etc.

The plan is to set up a couple cameras in the scene with good angles, a few dolly tracks, etc. and then have a very dynamic cinematic gameplay where shots rarely repeat because if the NPC wandered over there you will get different camera angles than the last time where you talked to him when he was over that other corner.
 
Top