Creating a World Camera - Udon/ VRChat SDK3.0

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
and the camera and screen to your vehicle is a ton of fun and it's super easy to make so let's get started first i'm going to fly down into my scene and to start with we're going to create the camera we're going to right click on the hierarchy and click camera now first things first we want to delete the audio listener and now we have a bunch of settings to play around with the only thing that i really care about is i'm going to change the field of view to something a bit wider this works better for more indoor scenes and we also want to come into colour mask and disable ui and ui menu this will stop any of the ui name tags and whatnot from popping up in the camera and other than that i'm just going to place it in a more convenient place by flying around and going ctrl shift f now that i've roughly placed my camera i'm going to come down into the console i'm going to right click create render texture under this texture and under size we will see what will become the resolution for our camera we want to keep this number relatively small as these are an additional pixels that your computer will have to render out on top of your vr headset or your main screen if you're on desktop personally i'm going to go double the default now we need to attach this render texture to the camera we just created so we're going to come down to our camera and just drag and drop our new render texture into target texture now as nothing is using this render texture we won't see anything so first of all i want to create a material i'm going to right click create material i'm going to call this screen material and now as most digital screens absorb all the light that comes to them so you can see the screen more clearly i'm going to use a shader that doesn't get affected by the lighting of our scene to change the shader i'm going to hit standard unlit texture and now i'm going to drag my render texture into the texture slot we now have a material to display our texture however we don't have an object to display it i'm going to right click 3d object plane to create a plane i'm going to rotate it zid by 90 and scale it down by a certain amount now when i drag and drop our material onto this plane we will see the output of our camera i can see that our plane is at a 90 degree angle to our camera as it is currently rotating round and round and round so to fix this i'm going to tweak the rotation until it's correct now i want my screen to be flush with my billboard so i'm just going to move it and tweak it that way now i'm opting to have a square screen however if you wanted to make this say a rectangle you would want to keep the ratio between your width and your depth the same on your rendered texture but as i'm keeping it square i want these to be the same awesome so now we've got all the logic set up it's time to create a camera in the world for our players to grab over here i have a camera that i made when i was just starting out with blender and i'm going to put it roughly where i want it to be in the world let me just fix its rotation and change its place in the hierarchy now on this camera i want to add a box collider and as i don't want any players to collide with the camera i'm going to set is trigger to true i'm then going to edit its bounds so it's in line with the camera and then i want to add a via chat pickup script now as i want players to be able to place the camera and it just float in midia i'm going to disable is gravity and turn on is kinematic and now on the pickup script i'm just going to add an interaction text of pick up camera and delete the use text as i won't be using it and we want to add a via chat object sync component and this means that when you move the camera it will move for everyone else as well now that we have a camera model that we can pick up and move around we now want to join the unity camera with the model i'm going to grab the camera in the hierarchy i'm going to drag the camera into our model making it a child of the model that way whenever we move the model the camera will move as well i now want to align the unity camera with our model camera to start with when we get rid of any transform and rotation we can see that it's at a 90 degree angles in my case so i'm just going to give that some rotation and then i'm just going to move it to be at the camera point now this image is a little bit large so i'm just going to come to the gizmos and just reduce 3d icon size awesome this is all good however there is a slight problem we'll notice that there is this box in front of the camera that doesn't quite come to this point this is known as the near clipping plane anything in between the camera model and that square you see will not show up in the camera we can reduce this by reducing the near distance and with that we now the camera can move around the world however when you're using this camera and you cannot see the screen you won't know what you are shooting this is fine in some cases but especially in larger worlds you really want the camera operated to see what everyone else is seeing so to add a screen to our camera we first need to grab our plane which i really should have named screen we're going to go ctrl d to duplicate it and then i'm going to attach it to our camera model i'm going to reset its position to 0 0 0 scale it down by like 10 and then move it in this small little screen area and all that's left is to tweak this to be about right where i want it we also want to remove the mesh collider that comes with the screen and all that's left is to test this and now that we're in the world we can pick up this camera and we'll see that the screen updates with it something i would like to mention about cameras however is that you should always have a toggle somewhere in your world for them as they are rather expensive on computing anyways hopefully that was helpful leave a like on the video if you liked it leave a comment down below if you've got any questions and feel free to check out one of my other tutorials but until next time bye
Info
Channel: PlayerBush001
Views: 5,780
Rating: undefined out of 5
Keywords: VRChat, SDK3, Udon, Worlds
Id: cOrQQIG5ZIk
Channel Id: undefined
Length: 4min 53sec (293 seconds)
Published: Mon Dec 27 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.