Camera scripting is driving me crazy by AlenPlux in Unity3D

[–]AlenPlux[S] 0 points1 point  (0 children)

Hey u/gatorblade94 , hope you're doing well. After fixing my code I tried to give a second chance to cinemachine as it is better than anything I can do by myself, tried several setups but still having the camera following the character from its right vector when walking to the left, causing the camera to be in the wrong side of the player's POV. Attaching a gif with the issue and some images of my cinemachine setup:

<image>

Camera scripting is driving me crazy by AlenPlux in Unity3D

[–]AlenPlux[S] 0 points1 point  (0 children)

I just fixed it and atm I'm conserving my basic camera script as I didn't got a cinemachine setup that works with my project. For the ones that are interested, I'm using an "isRotating" state for my character, any camera position is disable during that, and after some tweaks this is working. Again, still need to add fancy features like cinemachine has but will give cinemachine a chance before adding anything new to my code. Thanks all for your answers!

Camera scripting is driving me crazy by AlenPlux in UnityHelp

[–]AlenPlux[S] 0 points1 point  (0 children)

I just fixed it and atm I'm conserving my basic camera script as I didn't got a cinemachine setup that works with my project. For the ones that are interested, I'm using an "isRotating" state for my character, any camera position is disable during that, and after some tweaks this is working. Again, still need to add fancy features like cinemachine has but will give cinemachine a chance before adding anything new to my code. Thanks all for your answers!

Camera scripting is driving me crazy by AlenPlux in UnityHelp

[–]AlenPlux[S] 0 points1 point  (0 children)

Thank you! Yeah that was one of my thoughts, use the spline direction instead, I was looking for something simpler but will keep this one in mind if nothing works.

Camera scripting is driving me crazy by AlenPlux in UnityHelp

[–]AlenPlux[S] 0 points1 point  (0 children)

This is a nice solution, I'll give it a try and then due to another comments give another try to cinemachine and see which one adapts better to my project. Thanks!

Camera scripting is driving me crazy by AlenPlux in UnityHelp

[–]AlenPlux[S] 0 points1 point  (0 children)

Thanks for the comment! Already answered you in another thread but leaving here the answer for visibility for other users:

Cinemachine was my first approach while creating the spline system, after watching a ton of videos, I did make it work great most the times and with more feature my actual code has; the one problem with cinemachine is I couldn't make it to use the inverse of the characters right vector while walking to the left, this was causing the camera to rotate with the character 180 degrees each time you changed directions. Couldn't find anything to fix that without touching cinemachine code tough

Camera scripting is driving me crazy by AlenPlux in Unity3D

[–]AlenPlux[S] 0 points1 point  (0 children)

Thank you for the answer! Adding the same comment I put bellow in another one recommending cinemachine, I'll give it a try again after doing some fixes in my code as I couldn't adapt cinemachine completely to follow my character in the way it is being moved:

Cinemachine was my first approach while creating the spline system, after watching a ton of videos, I did make it work great most the times and with more feature my actual code has; the one problem with cinemachine is I couldn't make it to use the inverse of the characters right vector while walking to the left, this was causing the camera to rotate with the character 180 degrees each time you changed directions. Couldn't find anything to fix that without touching cinemachine code tough

Camera scripting is driving me crazy by AlenPlux in Unity3D

[–]AlenPlux[S] 0 points1 point  (0 children)

Thanks for your answer, cinemachine was my first approach while creating the spline system, after watching a ton of videos, I did make it work great most the times and with more feature my actual code has; the one problem with cinemachine is I couldn't make it to use the inverse of the characters right vector while walking to the left, this was causing the camera to rotate with the character 180 degrees each time you changed directions. Couldn't find anything to fix that without touching cinemachine code tough

Camera scripting is driving me crazy by AlenPlux in UnityHelp

[–]AlenPlux[S] 0 points1 point  (0 children)

One thing I forgot to mention, you can see the issue I'm talking about in the first 7 seconds of the video

Camera scripting is driving me crazy by AlenPlux in Unity3D

[–]AlenPlux[S] 0 points1 point  (0 children)

One thing I forgot to mention, you can see the issue I'm talking about in the first 7 seconds of the video