(im new to this forums so idk if this is the right place to ask this question)
i have multiple scenes that need screenboxes so the cinimachine confiner so it doesnt overlap the edge of the art. i use a box collider, composite colider and the cinimachine confiner addon. whenever i write a script to move the player and camera to a diffrent screenbox once they reach the edge, it always moves the player but never the camera. is there a reason for this? and if there is can i fix it?
or do i have to use multiple cameras and switch between them
If you move the player, then the camera will automatically follow if it’s tracking the player - unless something prevents it from doing so.
Is the player the camera’s target?
Do you have multiple colliders, one for each screenbox? If so, and if you move the player to a different screenbox but don’t change the vcam’s bounding shape in the CM collider, the vcam will stay inside the old bounding shape.
the player is the cameras target. and i had 2 screenbox colliders on each frame (screenbox colliders to keep the camera from showing unwanted frames while the player moves around (but you probobly already knew that)) however even if i moved fully into the other screenbox the camera still didnt lock onto the player.
thanks for the tip about changing the vcams boundary screenbox.
i just dont know how to do that
(sorry i didnt respond untill just now, i hadnt checked notifications.)
ps i made a temprory and (what i think is) sloppy fix for the camera problem by moving the same screenbox to the exact cords i need it to be at every time the player enters a new screen (using trigger colliders).
its kinda glitchy sometimes but i just needed a temp fix so i can keep creating lvls and seeing how they look
You can try having a separate vcam for each screenbox, and when your player moves to a new box you activate the associated vcam and let CM blend to it.
Alternativeley, if you want to keep a single vcam, you can change the confiner shape by doing vcam.GetComponent().m_BoundingShape2D - myNewConfiningBox (assuming it’s a 2D camera). However, you might not get smooth blending if you do it this way.
I know its been a while since i posted on this thread but iv just got the code to work properly for the multiple vcams and it turns out if i dissable one and reactivate it for use when the player enters the sceebox, the cimemachine confiner stops working for some reason (its a really good method for switching screen boxes and i would like to use it im just wondering why this glitch happens)
im on my project rn and i dnt know hwo to check which version of cinemachine im using, all i have are 2 cameras CMvcam1 CMvcam2 a screenbox that has a collider (the collider works before i dissable the CMvcams, then when i reactivate them they dont follow the collider would i need to dissable the collider to? mabye im dumb and thats the solution)
however i cant currently change anything on my unity project (theres another issue im working on fixing where i cant drag and drop anything) so i cant see if that solution i mentioned will work
For me the confiner continues to work as I cycle the vcam between active and inactive. Is it possible that there is something unusual about your setup?
Can you make a small lightweight project that reproduces this problem?
weird. when i tried to recreate it, nothing happens. im gonna try slowly adding components from my original project into my recreation to see what is causing it. in the meantime here are my two scenes
(i couldnt figure out how to atatch a script like a file)
(this is everything i have in each of em)
(Deleted for the sake of not taking up 90% of the entire thread)
Thanks for trying, but it’s very difficult for me to wade through that soup
You can just drop files onto your post to attach them, or if you want to insert an image you can paste it directly in the message. To insert code in a readable way, use this button: