💬 Do you know there's a bunch of super useful Cinemachine Extensions? The Confiner will help keep your camera inside a certain area, very easy to add! 🌐 Have you found the videos Helpful and Valuable? ❤️ Get my Courses unitycodemonkey.com/courses or my Steam Games 🎮 unitycodemonkey.com/gamebundle
I`ve spent several hours looking for a way to restrict player from seeing the emptiness and every video was a total BS, using various scripts to calculate tileset's length and etc, I almost lost my hope and then I just found your video, where you fixed my problem in just under 6 minutes. Thank you very much, never knew Cinemachine had functions like that(They actually give pretty strange names to imporant components, just naming the component as "View Border" is much more telling than "Confiner")
I recently used this very efficiently in a 3D action game where I wanted the camera to ALWAYS stay above y=0 (no matter how low the character got). I did want a clean follow if the character was higher than that. Confiner to the rescue.
But when you change the level and there is different polygon collider in every scene how can you maintain that because it each times it losses it refrence
I have a question: This function works when im using the perspective projection in the main camera?? in the video you used the orthografic projection. btw your tutorial always help me with my projects
Hmm I didnt test it but I think it should work, although it might just work to block the camera position itself and not what the field of view sees, might need to do some math for that.
First, on the virtual cam, under the confiner script that is added, I don't have the checkbox "confine screen edges" to select. Second, I have a situation where I ONLY need the camera to pan on the X axis, and only by a very tiny amount... and it's like that for every level in the game and it will be the background that moves. I can't have a confiner that is smaller than the camera, right? (I have a UI that takes up the rest of the screen space on top as a canvas layer) At any rate, I've followed through well over a dozen guides and I can't get any of it to work; it doesn't switch to the virtual camera and boundaries don't work (even when trying to make the confiner larger than the camera. It should be super easy and I follow each one step by step but I would be humiliated to admit just how long I've been trying to get this to work and I am at my wit's end. Is cinemachine even the right option for my project? I was hoping to use it since coding is my weak point that I'm trying to develop, but at this point I've wasted enough time, and what I need to do is simple enough that I'd almost rather try to learn to do this using code. Thoughts?
Haven't played them but with Cinemachine you can do all kinds of things very easily. One super useful thing is how you can set up your Virtual Cameras in any way you want them and then swap between them by playing with the priority.
How weird? Does it have enough space to fit the camera? If you make it super small or zoom out a huge amount it won't be able to fit the camera in the area
Thank you for the video! General question about Cinemachine. If we need to control a camera inside a game (so it is not static) when you would NOT recommend using Cinemachine (e.g. maybe in the mobile projects because of calculation intense)?
The only reason not to use it is if you have a very specific use case where you need some very specific exact control over the camera. But Cinemachine has tons of features so in 90% of cases it will be the best option compared to writing your own from scratch.
Quick question: Couldn't you have used the Box Collider that you were using to restrict the character movement as the reference for the Camera Collider also? Rather than making a separate box for each?
If you had a collider on top of the walking area yes, but what I have in the demo are 4 separate solid walls that the player cannot go through. That would work but that design would require a different character controller that instead of hitting walls it would test if its inside a valid walking collider.
I took the course but my camera, just goes straight over the boundary. The actual area the player can see still confines, but you have to hold the controls down to come back. Aka, the main camera is moving beyond the boundaries, the virtual is not
I am working on a 2D Platformer where the level is put together by multiple parts in a random order. How would you limit the cinemachine camera when you don't know exactly what the level will look like? I want this to be done by a single camera without any transitions between cameras. Is there a way to do this?
I have this issue when my cinemachine doesn't work when i attach my player to it. My project can float away, player spawns in different wierd ways or else. Maybe you know how to fix this?:( P.s. I made Player as a prefab and all the issues are gone.
You project floats away? What does that mean? If you set Cinemachine to follow a game object it will follow that game object, it shouldn't float away from that object unless that object is hte one floating away
I have my Background, Foreground and Player objects and they all floats slowly into the down left corner of the screen, the only thing that can stop them from doing this is to remove Player from Follow field in the Cinemachine I see, but why my GameObjects might float away? I tried to make new one and i saw the same issues
In the scene view its all GameObjects, Canvases and MainCamera that are floating away, but i tried to remove Cinemachine and add a new one and now my character is getting squeezed on Y axis
*Can you please* make the *tutorial* for the camera smooth movement in the middle of player-cursor distance. You said in comments it's done easily with cinemachine, but we can't figure out exactly how to do it. (ps. 2D TopDown game)
I covered that here th-cam.com/video/fuGQFdhSPg4/w-d-xo.html You calculate the direction and distance towards the mouse, then the camera position will be playerPosition + dirToMouse * (distanceToMouse / 2f)
unfortunately, enabling 'ignore raycast' does not solve my problem and the collider keeps messing with the physics of my game. i don't know what to do, and i don't understand the physics settings, either. :( can anyone help me?
You can also put it in a separate layer, then go onto Edit - Project Settings and in the Physics Collision Matrix make sure that layer doesn't interact with anything else.
Hey I was wondering if u could teach how to remake fortnite I kinda wanted to bring back og fortnite or just my own online battle royale that every server can have a minimum of 3 players and a 1v1 game mode for 2 players and a lobby lol
💬 Do you know there's a bunch of super useful Cinemachine Extensions? The Confiner will help keep your camera inside a certain area, very easy to add!
🌐 Have you found the videos Helpful and Valuable?
❤️ Get my Courses unitycodemonkey.com/courses or my Steam Games 🎮 unitycodemonkey.com/gamebundle
could you make a short one like this but for the offset extension where the camera moves slightly after the cursor for a more reactive feel
Instablaster
I`ve spent several hours looking for a way to restrict player from seeing the emptiness and every video was a total BS, using various scripts to calculate tileset's length and etc, I almost lost my hope and then I just found your video, where you fixed my problem in just under 6 minutes. Thank you very much, never knew Cinemachine had functions like that(They actually give pretty strange names to imporant components, just naming the component as "View Border" is much more telling than "Confiner")
yay! I always was wondering how to do this!
Now you know it!
Thankz Code Monkey . Insane as Always .
I was having a problem with the void of the map and struggling with the script to solve it. Thank you very much for this savior video 😊😊
This is perfect, I just started working on a project where this is needed and was wondering how to do this, thank you for this :)
This Tips are always really incredible!
And not just the Tips for there own, I mean i just learned that there are polygon-colliders!
Plz make a topdown survival game tutorial, ilove your vids
A top down tutorial ehh. Well that's a good idea. I love top down games and become pretty good at making them in Unity3d
I recently used this very efficiently in a 3D action game where I wanted the camera to ALWAYS stay above y=0 (no matter how low the character got). I did want a clean follow if the character was higher than that. Confiner to the rescue.
Interesting use case!
Great. These built in features with its settings makes it less and less necessary to write code.
GOOD LEARNING BRO NICE 👍
Thank you, was really looking for arun through on how to do this.
Thanks, It helped a lot
Yes!
Thanks for the help
So useful! Thanks!
You are rock!
Amazing. Thank you so much.
Thank a lot! ;D
Love your vids!
901st like 😎 btw Good work
Great tutorial!
How do you feel about doing tutorials on procedural animation?
Thanks
You is awesome!
can you please made this types of sort basics tutorial s
Helpful👍
Good video comrade
Me: Thinks about this proplem for my next game
TH-cam Recromendation: Shows this Video
Me: Can you read my mind?
Can you create a video about bloodhound's abilities in apex legends? lik you created the cyberpunk's mechanics!!!!
Your grate!
please create an ecosystem tutorial!
What if you had multiple rooms and you wanted the camera to switch between them when the player transitioned from one to the other?
cinemachine extension called cinemachine collider can do that
Please make series top down shooter game from scratch
Nice
But when you change the level and there is different polygon collider in every scene how can you maintain that because it each times it losses it refrence
You can modify the field through code after you load the level
I have a question: This function works when im using the perspective projection in the main camera?? in the video you used the orthografic projection. btw your tutorial always help me with my projects
Hmm I didnt test it but I think it should work, although it might just work to block the camera position itself and not what the field of view sees, might need to do some math for that.
Muy bueno!
First, on the virtual cam, under the confiner script that is added, I don't have the checkbox "confine screen edges" to select. Second, I have a situation where I ONLY need the camera to pan on the X axis, and only by a very tiny amount... and it's like that for every level in the game and it will be the background that moves. I can't have a confiner that is smaller than the camera, right? (I have a UI that takes up the rest of the screen space on top as a canvas layer) At any rate, I've followed through well over a dozen guides and I can't get any of it to work; it doesn't switch to the virtual camera and boundaries don't work (even when trying to make the confiner larger than the camera. It should be super easy and I follow each one step by step but I would be humiliated to admit just how long I've been trying to get this to work and I am at my wit's end.
Is cinemachine even the right option for my project? I was hoping to use it since coding is my weak point that I'm trying to develop, but at this point I've wasted enough time, and what I need to do is simple enough that I'd almost rather try to learn to do this using code. Thoughts?
I've used a different way before with tilemap, but that one is a big step better.
I really like your work. Is it possible for you to make a video about camera controller like the games inside or until down has?
Haven't played them but with Cinemachine you can do all kinds of things very easily. One super useful thing is how you can set up your Virtual Cameras in any way you want them and then swap between them by playing with the priority.
🔥🔥🔥
I need this but i have rooms and the player teleports to new once reached the gate. Wont the camera get stuck?
If you teleport then you would also change the Collider when teleporting to the new one
Does it work with a 2D Box Collider, instead of a polygon collider?
Yes it works with any type of Collider
@@CodeMonkeyUnity Thanks for the reply!
Thank you, very useful. Do you also use 2d collider for a top-down/isometric camera in 3d game ?
If you have a 3D Camera then you would use a 3D Collider
@@CodeMonkeyUnity thanks
If you try to use L shaped polygon collider as confiner, camera acts weird. Dunno how to solve.
How weird? Does it have enough space to fit the camera? If you make it super small or zoom out a huge amount it won't be able to fit the camera in the area
Thank you for the video!
General question about Cinemachine. If we need to control a camera inside a game (so it is not static) when you would NOT recommend using Cinemachine (e.g. maybe in the mobile projects because of calculation intense)?
The only reason not to use it is if you have a very specific use case where you need some very specific exact control over the camera.
But Cinemachine has tons of features so in 90% of cases it will be the best option compared to writing your own from scratch.
Quick question: Couldn't you have used the Box Collider that you were using to restrict the character movement as the reference for the Camera Collider also? Rather than making a separate box for each?
If you had a collider on top of the walking area yes, but what I have in the demo are 4 separate solid walls that the player cannot go through.
That would work but that design would require a different character controller that instead of hitting walls it would test if its inside a valid walking collider.
I took the course but my camera, just goes straight over the boundary. The actual area the player can see still confines, but you have to hold the controls down to come back. Aka, the main camera is moving beyond the boundaries, the virtual is not
Can you make a video on how to protect your game's by being stolen or copied by others.like in your own way.❤️
Why don't make boundaries and spread it to the exposed camera area?
i guess by using tiles you can automatically set the bounding box to the tiles corners
Yeah you could use the TilemapCollider as the bounds
Hello Code Monkey ! Could you please make a video about making Textmesh Pro font from Image ?
Do you mean a custom font from an image? I covered that here th-cam.com/video/nBcP7FaDPE0/w-d-xo.html
I am working on a 2D Platformer where the level is put together by multiple parts in a random order. How would you limit the cinemachine camera when you don't know exactly what the level will look like? I want this to be done by a single camera without any transitions between cameras. Is there a way to do this?
Not sure what you mean by multiple parts but if you're creating the level dynamically then you can also create the collider points dynamically
@@CodeMonkeyUnity Thank you. I will give this a try
Я украинец но люблю смотреть Code Monkey=)))
Никто не узнает что я написал XD
Thanks for watching! Google Translate is pretty great!
I have this issue when my cinemachine doesn't work when i attach my player to it. My project can float away, player spawns in different wierd ways or else. Maybe you know how to fix this?:(
P.s. I made Player as a prefab and all the issues are gone.
You project floats away? What does that mean?
If you set Cinemachine to follow a game object it will follow that game object, it shouldn't float away from that object unless that object is hte one floating away
I have my Background, Foreground and Player objects and they all floats slowly into the down left corner of the screen, the only thing that can stop them from doing this is to remove Player from Follow field in the Cinemachine
I see, but why my GameObjects might float away? I tried to make new one and i saw the same issues
Look in the Scene view in order to identify if it is those objects that are randomly moving away or if it's just the camera moving
In the scene view its all GameObjects, Canvases and MainCamera that are floating away, but i tried to remove Cinemachine and add a new one and now my character is getting squeezed on Y axis
thank for your time! :)
*Can you please* make the *tutorial* for the camera smooth movement in the middle of player-cursor distance.
You said in comments it's done easily with cinemachine, but we can't figure out exactly how to do it.
(ps. 2D TopDown game)
I covered that here th-cam.com/video/fuGQFdhSPg4/w-d-xo.html
You calculate the direction and distance towards the mouse, then the camera position will be playerPosition + dirToMouse * (distanceToMouse / 2f)
unfortunately, enabling 'ignore raycast' does not solve my problem and the collider keeps messing with the physics of my game. i don't know what to do, and i don't understand the physics settings, either. :( can anyone help me?
You can also put it in a separate layer, then go onto Edit - Project Settings and in the Physics Collision Matrix make sure that layer doesn't interact with anything else.
What is void?
Hey I was wondering if u could teach how to remake fortnite I kinda wanted to bring back og fortnite or just my own online battle royale that every server can have a minimum of 3 players and a 1v1 game mode for 2 players and a lobby lol
Code Monkey
Your channel is to me now what Brackeys was 2 years ago. But please please, pretty please can you switch to dark mode?
Pog
Ok
@@fen4flo Ok
I don't even know how to make a camera
Can you please help me with a Level for my game? It’s gonna be really hard to make on my own.
Me with a fps camera:
You won’t break me TH-cam, I’m not buying fucktube premium!!!!