(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<CinemachineConfiner>().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)
let me check 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:
That's a little better... Still, there are just a bunch of loose files, I don't really know how you've connected them in your scene. Have you tried exporting your scene as a unity package? Then I can import it into an empty project and run it as you've set it up. Be sure to include your scene and the dependent scripts and resources
well there is a door in a tree and the goal is to have a room that it teleports you to if you push the up arrow but the collider breaks oh oops forgot to change the charicter sprite xD tolate if you cant tell im really bad at posting stuff on forums and not mesing it up
There is no scene in your package, only scripts. You have to include a scene in the unitypackage, and whatever else is needed to run it. A good way to test it is to create an empty project, import Cinemachine, then import your package and try to repro the problem. That is what I will do. If you can't do it that way, neither can I
ok so i need to include the scenes? also i slowly started importing more things from project 1 in to see what was breaking it im realllyyyyyyy bad at importing stuff and explaning problems sorry for wasting ur time
Take your time. If you like, you can zip up the whole project and just PM it to me. (be sure to delete the Library folder first, Unity will regenerate it and it's huge) Also, please give me clear repro steps - every project is different
ok im in export package (or whatever) and i have every thing selected i think i did it corectly project 2
ok, I got it and it runs. I get an empty screen in the game view. What exactly to I have to do to see the problem?
it.. hm it shouldnt be running an empty screen atm im trying to figure out why it runs that ill eventualy figure it out but it might take some time
Make a copy of your entire project In the copy, delete everything except Assets, Packages, and ProjectsSettings. Do this in the file explorer, without running Unity Zip it up PM it to me (or post it here if you want the whole world to know what you're doing) Make sure to enclose precise instructions for how to see the problem
When you say "runs fine", do you mean that it shows the problem? If so, you can upload it somewhere and send me a link.
hmm it runs fineish im trying to test it and every time i import it into an empty project it "works" more or less but not in the way its suposto. the player can move and stuff but the cameras to large and most if not all of the scripts seem to not work accept for the player movment