Wednesday, 18 March 2020

More Camera Progress

Cameras are one of the last main functionality items I need to finalise before I continue with re-modelling. That and they've provided a nice break from 3DS Max.

Previously I was testing vertical cams. I have made progress on this front. I was using Cinemachine in my last test with their virtual cameras. The issue with these is that they cause aweful snapping between other camera triggers and the player can also get caught in trigger loops and end up spinning on the spot. This is why I've focused more on Unity's default camera system.

Still though, I couldn't get nice movement with the default cameras, but I could with Cinemachine, because of its dolly track system. I did make progress in my last video using a "Dolly Camera with Track" object, but because it has a vcam, its very hard to integrate it with my other mechanics and still has the issues mentioned.
I did however find a nice medium between the two. Theres another object called "Dolly Track with Cart", this is exactly the same track system just without any cameras. So the cart acts as an empty object in which you can animate and do anything with:



 So, the first thing I did was attach a normal camera to this cart and see if it worked and voilĂ !

The camera properly moved in any direction I set the track as. The image above shows the track in a vertical position. Because it has waypoints and a current position variable I can move this how I need via triggers etc.



The next step was to make a script (still WIP) to access the aspects I need at runtime. So here I have the player to track, the cart to animate, which track it's using and the camera to affect, followed by values to edit and that feedback information to testing.

Finally to get it to where I need it to be I had to add a distance check from the camera to the player, this value is then fed to the carts position on the track with a modifier to increase or decrease the effect.
Here is a brief clip in-editor showing the camera working exactly like it does in the original:



Here is a comparison link to a playthrough of the game (its set to start right at this same moment), where you can see the camera's blue / Z axis mimics the exact movement in this video: Silent Hill Playthrough (5:10).

Next step is to tweak these vertical tracks to closer match the results I want, then finish up the rest of the camera triggers for these alley areas.

No comments:

Post a Comment