No video

Smooth PORTALS in Unity

  Рет қаралды 454,499

Brackeys

Brackeys

Күн бұрын

Get all Udemy courses for only $10.99: bit.ly/BRACKEYSJAN
The link above is an exclusive limited $10 site wide deal that expires soon so... go nuts!
In this video we create a smooth portal effect in Unity!
● Download Shader: goo.gl/iKCk1r
● Project on GitHub: github.com/Bra...
The video is based on this video by Killian McCabe: goo.gl/YWHT2G
♥ Support our videos on Patreon: / brackeys
····················································································
► Join Discord: / discord
♥ Subscribe: bit.ly/1kMekJV
● Website: brackeys.com/
● Facebook: / brackeys
● Twitter: / brackeystweet
········································­­·······································­·­····
Edited by Sofibab & LeBonques.
········································­­·······································­·­····
► All content by Brackeys is 100% free. We believe that education should be available for everyone.
❤️ Donate: www.paypal.com...
········································­­·······································­·­····
♪ Baby Plays Electro Games
teknoaxe.com/cg...
♪ Funin and Sunin Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 3.0 License
creativecommons...

Пікірлер: 988
@mrspacemonkey3831
@mrspacemonkey3831 6 жыл бұрын
yes please do a video on writing shaders
@tgsoon2002
@tgsoon2002 6 жыл бұрын
Check out "Makin' Stuff Look Good" channel. It not active much, but the original arthor doing alot of graphic script for unity. Very good source.
@SubjektDelta
@SubjektDelta 6 жыл бұрын
He should do a full series on it.
@brendethedev2858
@brendethedev2858 6 жыл бұрын
I 161st this
@alinawaz4034
@alinawaz4034 6 жыл бұрын
yes please make a video on shaders
@AD-xt7tg
@AD-xt7tg 6 жыл бұрын
If you do shaders please do how to make a red dot sight with infinite parallax!!!!!
@neomaycry7
@neomaycry7 6 жыл бұрын
Two things I love about this video: 1) The pace - You keep a steady pace from beginning to end and never ramble. 2) The "advanced" lesson - It's difficult to find 'intermediate' and 'advanced' lessons covering Unity. This lesson is great for those of us who have more programming experience and a fundamental grasp of Unity. Keep up the great work!
@AROD-oh5ez
@AROD-oh5ez 6 жыл бұрын
Agreed. SO many tutorial makers just ramble and ramble (*cough* TheCherno) and their videos end up being 20+ minutes long when they could be made easily just 10 minutes long. This is why I like Brackeys!
@AlexanderZotov
@AlexanderZotov 6 жыл бұрын
Brackeys is God of Unity for sure)
@user-th8nx4cp7w
@user-th8nx4cp7w 4 жыл бұрын
another thing is that some youtuber making tutorial sounds like they are gonna fell asleep
@cmdrblaze6487
@cmdrblaze6487 4 жыл бұрын
@@user-th8nx4cp7w And make the viewers fall asleep as a result
@Muse5897
@Muse5897 3 жыл бұрын
ooOKjUauuskakakoaoaoaoo
@thevfxwizard7758
@thevfxwizard7758 5 жыл бұрын
For anyone noticing the one-frame lag, under the PortalCamera script, change void Update to void LateUpdate to draw the portal just before the frame is rendered and after the character movement is calculated.
@H1zoneTv
@H1zoneTv 3 жыл бұрын
Thanks!!!
@kosuken
@kosuken Жыл бұрын
thx
@Mateen_TV
@Mateen_TV 2 жыл бұрын
Make sure that “Auto Sync Transforms” in the Physics section of Project Settings (which can be accessed from Edit) is enabled. If this is not enabled, you’ll find that when your character gets to the Teleport Pad, you’ll be able to see the Teleport Target for a split second but your character will not change position.
@kgbchambers
@kgbchambers 2 жыл бұрын
I think I love you? I have been trying to fix this for weeks and it fixed everything
@shrewsbury666
@shrewsbury666 2 жыл бұрын
This comment should be the most rated
@suganthg1911
@suganthg1911 2 жыл бұрын
Wow U r amazing
@suganthg1911
@suganthg1911 2 жыл бұрын
@@kgbchambers S same here searching for 1 week in unity community page and just found in u tube comment 🤣
@jasonyeh3595
@jasonyeh3595 2 жыл бұрын
I'm really sorry but it still doesn't work. After even trying other's teleport script I realized my player model just ignores the trigger and goes through the planes.... Any reason and how to fix it? I don't know how to code so it's driving me mad....
@spoekles
@spoekles 6 жыл бұрын
Shaders sound SUPER interesting, never really understood what they actually do. Would love a video about this!
@Schytheron
@Schytheron 6 жыл бұрын
Snikur Always wondered what the difference was between a vertex and fragment/pixel shader. Always assumed they were the same thing. Now I know. Thanks!
@alexthebassist23
@alexthebassist23 6 жыл бұрын
A shader video/series would be great. I just want to replicate the grass you made for the shrinking planet game ;)
@Xanhomey
@Xanhomey 6 жыл бұрын
And The Award for the best KZfaqr Ever Goes to Brackeys!!
@BrianBakerCA
@BrianBakerCA 6 жыл бұрын
Seriously, if game dev wasn't such a niche subject he'd be huge! Production quality, teaching style, content choice... Brackeys is amazing
@miksuko
@miksuko 6 жыл бұрын
That went to LEMMiNO 20 mins ago according to a comment
@Rossilaz58
@Rossilaz58 5 жыл бұрын
Lemmino? Captain Disillusion?
@dhyanavsiddhapuria2786
@dhyanavsiddhapuria2786 3 жыл бұрын
no surprise if he gets that award
@JujuProdGames
@JujuProdGames 3 жыл бұрын
For anyone wondering why their player is rapidly going back and forth (your screen is probably flickering between rooms really fast), it's because you need to rotate the collider plane by -90 degrees on the x-axis. There goes half my Friday :D
@bonemanbob9885
@bonemanbob9885 Жыл бұрын
Oh hey you're that guy who made that portal tutorial in 2 minutes. I went and watch yours first before watching Brackeys. Really love the explaining literally at a quick 2 minute pace including quaternions and vectors. Gave me a quick recap during the listening to Brackeys
@mwrazer
@mwrazer 3 жыл бұрын
Anyone else watching all of his older vids after he announced they wouldn't make any more? Still hurts but I wish the team at Brackeys a great time doing whatever they are doing
@green3y3guy
@green3y3guy 6 жыл бұрын
Can you make a video on how to do customizable characters? Switching clothes, hair, color, etc.
@lavrlevcat
@lavrlevcat 4 жыл бұрын
green3y3guy that would be cool
@c1oudsky
@c1oudsky 4 жыл бұрын
isn't that just a bunch of code switching gameobjects and saving what you chose?
@lavrlevcat
@lavrlevcat 4 жыл бұрын
C1oudS well Idk how to make the colour changer wheel that changes the colour of the selected object but u are right tho
@c1oudsky
@c1oudsky 4 жыл бұрын
@@lavrlevcat oh well, I guess you should google that instead
@lavrlevcat
@lavrlevcat 4 жыл бұрын
C1oudS ok I’ll do so maybe if I’ll made it I’ll make a link for it
@sheenufilms
@sheenufilms 4 жыл бұрын
Dude, you are a life saver. Thank you, and please don't EVER stop making videos!
@trzy
@trzy 4 жыл бұрын
Note: The camera rotation math here is very wrong. It *only* works for yaw (left to right) and pitch (up and down) but will break badly if roll (tilting head side to side) occurs, making it unsuitable for e.g., VR, where your head will never be perfectly aligned with the floor. The correct math is a simple one-liner for rotation. Here is the whole LateUpdate function: Vector3 userOffsetFromPortal = Camera.main.transform.position - transform.position; m_otherCamera.transform.position = m_otherPortal.transform.position + userOffsetFromPortal; m_otherCamera.transform.rotation = m_otherPortal.rotation * Quaternion.Inverse(transform.rotation) * Camera.main.transform.rotation; My GameObjects are wired up a bit differently. m_otherCamera refers to the camera in the other map. This script lives on the portal itself (transform). m_otherPortal refers to the other side of the portal, in the other map, where the other camera is observing.
@atomlight5568
@atomlight5568 4 жыл бұрын
I'll test it out thank you 🌹
@Aparino
@Aparino 3 жыл бұрын
.
@LeeTwentyThree
@LeeTwentyThree 2 жыл бұрын
Thank you! Works much better. Wish I could upvote multiple times.
@hapdio4331
@hapdio4331 3 жыл бұрын
If your character isn't teleporting, you need to turn off and on your character controller momentarily while teleporting by using this line of code: player.GetComponent().enabled = false; This is what it looks like after applying: player.GetComponent().enabled = false; // teleport: // rotation float rotationDifference = -Quaternion.Angle(transform.rotation, reciever.rotation); rotationDifference += 180; player.Rotate(Vector3.up, rotationDifference); // movement Vector3 positionOffset = Quaternion.Euler(0f, rotationDifference, 0f) * portalToPlayer; player.position = reciever.position + positionOffset; player.GetComponent().enabled = true; playerIsOverlapping = false;
@_masterlink_3211
@_masterlink_3211 9 ай бұрын
Thank you SOOO much. I was having trouble with this and knew it was something to do with the Character controller but didn't know how to fix it!!!
@DuyDoan-bh7oc
@DuyDoan-bh7oc 2 күн бұрын
excuse me, this code will be added to Player Object, right ?
@jupitersky
@jupitersky 6 жыл бұрын
Learning about shaders sounds cool!
@chinmaygawande8008
@chinmaygawande8008 6 жыл бұрын
Sometimes a professional c# and unity programmer also get confused in some tricky things but brackeys was always there to help me . Thanks for your support always..😀
@alaslipknot
@alaslipknot 6 жыл бұрын
*YES SHADER VIDEOS PLEASE!!* the internet is so full with unity beginner-intermediate tutorials, I have never have the need to write my own shader that's why i never went deep-searching for ressources, but it would feels really good to acquire that knowledge. Thanks!
@aleksadjordjic1631
@aleksadjordjic1631 6 жыл бұрын
You uploaded this video just when i was searching for making portals in Unity , great timing xD
@magist7077
@magist7077 6 жыл бұрын
true story, i was too, when i make game at was
@Vinz_1223
@Vinz_1223 6 жыл бұрын
The camera sync should be done in LateUpdate to ensure that the camera movement of the player camera controller is done before syncing to the portal cameras to prevent the slight desync jittering you can notice when quickly rotating the camera.
@Kappinski
@Kappinski 6 жыл бұрын
I just paused the Unity course you mentioned to watch some videos. Ben Tristem's courses are great! Funny coincidence that you talk about it :D
@fnord_lander
@fnord_lander 6 жыл бұрын
So glad I subbed. I am a music producer getting into game dev and your videos this past week have been really helpful. Learning at a much faster pace than I thought I would.
@artemis8368
@artemis8368 2 жыл бұрын
To anyone who had an issue with the character jittering or moving rapidly back and forth during teleportation, the issue for me was the first person starter asset. Just go to PlayerFollowCamera object. Inside the section called "body", where it says "damping", change the values for x, y and z to 0. I was literally looking for this solution for hours and hours.
@bonusstage6761
@bonusstage6761 2 жыл бұрын
i can't download the shader anymore. if it's there a link u can give me, i really appreciate it
@Darkblu242
@Darkblu242 Жыл бұрын
@@bonusstage6761 same did you find it?
@Kaerfca95
@Kaerfca95 Жыл бұрын
Late, but THANK YOU!
@Ruxiik
@Ruxiik 6 жыл бұрын
There's just one issue, the camera seems to be rotating (or rendering) at different times . When you move (for example) sideways you can see the pillars that make up the portal. It's like there's a small delay. Anyway, love the video!
@GamesEngineer
@GamesEngineer 6 жыл бұрын
If you change the name of the Update() function in the PortalCamera script to be LateUpdate(), then that delay goes away.
@chlorobyte_projects
@chlorobyte_projects 5 жыл бұрын
OnPreCull() would be more preferable, pretty much nothing should move the camera after that.
@hynnd323
@hynnd323 4 жыл бұрын
@@chlorobyte_projects Youre right! OnPreCull() works even better than LateUpdate() thank you!
@theitalianmonkey
@theitalianmonkey 4 жыл бұрын
@@chlorobyte_projects Thank you!
@darek21a
@darek21a 2 жыл бұрын
@@chlorobyte_projects Thank you
@enerzise3161
@enerzise3161 5 жыл бұрын
My son and I are talking about using this to make it so players can go into and out of cave missions. We might use CTS Shader to cull the texture where the cave entrance is, so we will not need to use the cameras, but if we did not want to remove the terrain texture, we could use your camera system too. Definitely an A++ tutorial.
@JustJunuh
@JustJunuh 6 жыл бұрын
Also, wouldn't it be best to place the "PortalCamera" class's code in LateUpdate()? That way, all the position corrections are done right **after** player movement is calculated and right **before** the frame gets rendered.
@loafy8532
@loafy8532 6 жыл бұрын
i was about to comment that
@VeNoM0619
@VeNoM0619 6 жыл бұрын
Yep, 24:05 you can see the edges of the other portal popping in and out every frame as he moves around.
@andreyrumming6842
@andreyrumming6842 6 жыл бұрын
I have just made a version of this that runs through 4 different rooms before eventually running back to the first one (It took a while but it looks really cool!), but I was having the same issue with the pillars showing up. After taking your advice and putting the PortalCamera class's code in LateUpdate(), the problem pretty much fixed itself. Thankyou so much for this one word modification that greatly increased the quality of my game!
@The28studio
@The28studio 6 жыл бұрын
Yeap that's it !
@gialex7240
@gialex7240 5 жыл бұрын
Thx my dude
@dotsplit
@dotsplit 6 жыл бұрын
Awesome tutorial and a great effect. The only problem I see immediately is if either room is bigger than the other, so if Room B is bigger than Room A, going to the far edge of Room B will show the outer wall of Room A.
@Matt-lm8tj
@Matt-lm8tj 2 жыл бұрын
Have you found how to dont have this problem ?
@dotsplit
@dotsplit 2 жыл бұрын
@@Matt-lm8tj You could likely adjust the near-clipping plane of the cameras to be the distance from the camera to the portal, but I believe that would cause an issue when viewing the portal from different angles. Another solution could be to use some custom shader and mask parts of the view. Don't take my word for it though. I never tried these options and the shader one is probably a bit advanced. If you try these, let me know how it went! EDIT: Now that I read this comment again, the shader one might not actually work :(
@Matt-lm8tj
@Matt-lm8tj 2 жыл бұрын
@@dotsplit I try to put 2 portals (the gameobject) and the camera in the same emptygame object world and it work, but if the camera or the gameobject portals are not in the same empty game object, i have this bug
@JackVXR
@JackVXR 6 жыл бұрын
how about a video on animating characters like changing weapon and interacting with components etc?
@allenlindenberg3732
@allenlindenberg3732 4 жыл бұрын
Amazing. I got it all working! Which is good as at the time of this post I have zero coding experience! Would just like to say that I had the problem where when I used the portal my player would be teleported back and forth very quickly due to the size of its collider. I solved this by not making the ColliderPlane the receiver. Instead I just made an empty object and put that infront of the portal, made sure it was facing the right way and made that the receiver. Boom, works are charm! Thank you so much!
@slowswift_I
@slowswift_I 6 жыл бұрын
You have so many videos on how to do such cool stuff in unity. How am I ever meant to watch them all. And I want to watch them all.
@Tbrekke
@Tbrekke 6 жыл бұрын
An interesting conundrum that crops up is when the portals have different rotations. The code for the camera movement is reliant on the portals facing exactly the same way. Anything else and it starts looking weird.
@Gunslinger962
@Gunslinger962 6 жыл бұрын
Shader programming is something that I reallly want to learn but I find it super hard to understand ! Make a video on shader programming too !
@itsttsi3858
@itsttsi3858 4 жыл бұрын
Brackeys: it doesn't have to be perfect Also Brackeys: proceeds to make it perfect
@samiyas100
@samiyas100 6 жыл бұрын
Simple shader tutorial will be awsome.
@altermann4072
@altermann4072 3 жыл бұрын
For the people who can't download that shader from description link drive.google.com/file/d/1P3HSi7alDGttF9R98xDW7OhtswLO1FHm/view?usp=sharing
@codyc1267
@codyc1267 3 жыл бұрын
Thank you so much. I was looking for something like this.
@Term1nus3st
@Term1nus3st 3 жыл бұрын
a hero
@hapdio4331
@hapdio4331 3 жыл бұрын
actual legend
@josh7145
@josh7145 2 жыл бұрын
a year later and still a hero
@Astorec
@Astorec 4 жыл бұрын
Hey all, If you can't get the teleport to work, change the void Update() method to void LateUpdate() in the PortalTeleporter script. That should fix your problem! If it works give a like to bump it up so hopefully other people can see it!
@faban561
@faban561 4 жыл бұрын
Thank you!
@joooosl
@joooosl 2 жыл бұрын
didnt work. If I check the player position in the function the position is the teletported one, so i assume, that I get teleported back immeadeately... I use the unity satandard assets character controller, which is the oone used in this tutorial i think..
@joshdoucette6802
@joshdoucette6802 2 жыл бұрын
I will try this My player seems like he teleports but he never exits out the other portal instead he exits on the portal he entered
@rianelite6157
@rianelite6157 Жыл бұрын
Still sometimes my player does not teleport. Can you help?
@EL-cb1nu
@EL-cb1nu 4 жыл бұрын
You win the internets of the decade!
@piskez5702
@piskez5702 6 жыл бұрын
DUDE, THIS THING IS AWESOME, THIS WAS THE EFFECT I WAS LOOKING FOR, I'v seen it some years ago in the stanley parable, and i loved it. THANK YOU SO MUCH
@spoons3344
@spoons3344 3 жыл бұрын
RIP Brackeys
@dilawar6884
@dilawar6884 6 жыл бұрын
Up for a shder coding tutorial, and thank for such good tutorials
@magnusm4
@magnusm4 6 жыл бұрын
Yes do a separate video on shaders! Such effects and features are extremely important to know and learn when making any type of game. Do it definitely
@handsomelessking
@handsomelessking 3 жыл бұрын
omg, thank you so much for that screen cut out shader, that's the only thing i needed for my superliminal looking window
@tristanphipson3864
@tristanphipson3864 6 жыл бұрын
Hey Brackeys, could you please do a tutorial on Custom Shaders?
@lordofduct
@lordofduct 6 жыл бұрын
So twice now people have come into the Unity forums after following this tutorial because the implementation does not compensate for proper rotations. I cleaned the code up the first time, and since shared it again the second time. Here's the original thread when someone came in with problems: forum.unity.com/threads/portals.522231/ I removed your 'PortalTextureSetup' class because this honestly is just garbo adhoc code that shouldn't be used. I moved the render camera positioning to LateUpdate (which I saw several commentors bring up here as well). I used an event driven teleportation instead of the adhoc approach done in this video. And of course... fixed the glaring rotational issue. You should try rotating your 2 rooms when testing. Anyways, here's the git project I modified for it: github.com/lordofduct/PortalsDemo
@Schytheron
@Schytheron 6 жыл бұрын
Hands down the greatest tutorial that exists on KZfaq. Have been looking for a good tutorial on this for sooooo long!
@cmilkau
@cmilkau 5 жыл бұрын
You dont need to compute angles. You can apply the rotation in the same way as the position, just use quaternion multiplication and division instead of vector addition and subtraction. They are designed to do the equivalent thing in their respective domain.
@solidslish2279
@solidslish2279 2 жыл бұрын
Can you expand on this?
@benoitduinat9885
@benoitduinat9885 4 жыл бұрын
Great Tutorial. How would you adapt to make it work in VR (where instead of having 1 camera A, you have 2 cameras left Eye, Right eye)
@ericbergevin1168
@ericbergevin1168 4 жыл бұрын
If you find an answer to this, can you please post a quick reply here? Thanks
@vripro-amberieu518
@vripro-amberieu518 4 жыл бұрын
just put monoscopic on OVRcamera rig. NP.
5 жыл бұрын
So, I'm trying to make this with VR. But apparently the code does not detect when the camera rotates on its X axis. (When I tilt my head sideways.). So sometimes the image through the portal stays put at a different angle. How could I change that?
@untoldecay
@untoldecay 5 жыл бұрын
Hey! I'm trying to do exactly the same. Adapting this tutorial for VR on oculus go. I had the same problem as you here. In VR you have stereoscopic vision, so you have to create 1 camera for each eyes, and render the texture on 2 superposed planes ( of course you'll have to create a tag filter to render 1 plane to 1 eye, and the other to the second eye. ) I still have distorsion anyway, that's not the end of the road. Here is a little gif untoldecay.com/gif/2goview.gif
@JustinsDustyShelf
@JustinsDustyShelf 6 ай бұрын
That’s so cool dude I’m definitely gonna try that
@syedshabih1798
@syedshabih1798 6 жыл бұрын
Yes please we really need in depth tutorials on shaders
@sheroose9177
@sheroose9177 6 жыл бұрын
Shader would be really interesting i guess
@alejandrogomez4158
@alejandrogomez4158 6 жыл бұрын
Make a video on how to make shaders
@babunga
@babunga 4 жыл бұрын
i love the explanation at the start cant ask for something better than this, obvs there's probably some other ways but tyty
@docyo8685
@docyo8685 4 жыл бұрын
That's Antichamber in a Nutshell. well done. I appreciate all the video you're making.
@liveisamelody9413
@liveisamelody9413 6 жыл бұрын
i had a bug where camera a and b where rotated exactly to the oposite side of the portal, by that i mean if i was looking through the portal the cam on the other side was basicaly also looking through the portal, in this case if there where objects on the other side and i didnt ran into the portal i wasnt seeing them.... but i fixed it just by going into the "PortalCamera" script and at line 25 (in your video its line 18) i multiplyed "angularDifferenceBetweenPortalRotatoins" by 2 so the cam was twisted by 180° again, facing the same way the global cam was facing. and that basicaly removed that mirror effect on both cameras and instead showed me exactly whats going on on the other side. and you also got it wrong in your video brackeys, so i hope this fixes it. and it shows it the right way if both rooms have the same global world rotation and just the portal is rotated by 180°. i hope this helps some people out and SUPPORT BRACKEYS! because he is friendly and comes up with great ideas. :) i think i dont need to mention that i wouldt had be able to come up with the portal thing, mostly because am lazy^^.
@jacobfoster9358
@jacobfoster9358 6 жыл бұрын
I need help, the portal is flipped upside down. Even when i flip the camera 180 on the x axis, nothing happens
@jacobfoster9358
@jacobfoster9358 6 жыл бұрын
Thank you so much, now I have a solid game!
@Amuntsen
@Amuntsen 5 жыл бұрын
This *barely works on beta 2018.3.0b7, there seem to be some issues with changing the transform.position of player with active Character Controller component. * There are major glitches on moving from RoomA to RoomB, oddly the other way works just fine.
@davidclark5523
@davidclark5523 4 жыл бұрын
Works fine for me, using version 2018.3.10f1
@aeyedeyen
@aeyedeyen 4 жыл бұрын
I've been trying to think of a way to do this type of real time portal in a 3rd person/isometric setting. So war the best I can think of would be facing out the camera from room 1 as you get close to the portal, then once you step through the portal, expanding the area room 2 used to take up into the whole screen. I want to try to work this out but I'm super new w unity. Thank you for making cool videos for newbies like me!
@TomtheMagician21
@TomtheMagician21 4 жыл бұрын
If it’s not working even with a rigid body, remember to change wherever it says other.tag to other.name and make sure that is what your player is named. It took me way too long to figure that out but now it’s great! 👍
@vvixell4580
@vvixell4580 3 жыл бұрын
no you can use tags
@DLRTwentyFive
@DLRTwentyFive 6 жыл бұрын
Shader tutorials would be awesome! I noticed on your render texture it looked like there was a frame of lag when the player moved. Wouldn't putting the "other camera" movement and rotation logic in LateUpdate fix this? Also why can't you just say transform.rotation = playerCamera.transform.rotation? Wouldn't that give you the same effect without all the complicated Quaternion math?
@shugabrush3671
@shugabrush3671 2 жыл бұрын
You have to consider the rotation in relation to that of the portal's.
@nicolasg3305
@nicolasg3305 6 жыл бұрын
For rotation can’t we do transform.rotation = firstcamera.transform.rotation ?
@chlorobyte_projects
@chlorobyte_projects 5 жыл бұрын
What if your portals are angled differently?
@Xaaaach
@Xaaaach 5 жыл бұрын
Benedani You have a point, but I think in this situation what he suggested might work.
@chlorobyte_projects
@chlorobyte_projects 5 жыл бұрын
Yeah but you'd need to ensure the two portals have the exact same orientation. It's just a dumb limit that you can easily fix by following the tutorial properly.
@nevyn
@nevyn Жыл бұрын
Love this. Really great step for step. Took a while for me to follow (4-5 watch-throughs) because I wanted to generalize it into a reusable Portal prefab, but you went through everything with excellent detail and tempo so it was all totally doable. Thank you!!
@ancapftw9113
@ancapftw9113 6 жыл бұрын
I'm taking the "learn to code by making games" course. It's a good course for a beginer.
@jadw1
@jadw1 6 жыл бұрын
Yes :D Make sth with shaders :D :D
@vistaero
@vistaero 6 жыл бұрын
What if I want to have a different rotation on each portal? this only works if both have the same rotation.
@AHSEN.
@AHSEN. 4 жыл бұрын
kzfaq.info/get/bejne/mb2geb2Tz9q3gZs.html Sebastian Lague has a video on that. His is a a lot more complicated I believe, but he shows the entire process, and has even shared the source code so you can check it out yourself.
@Lloydchen07
@Lloydchen07 6 жыл бұрын
I would greatly appreciate a video (or a series) on shaders from you, Brackeys. In almost every gaming project I'm working on right now, there's a point at which specific tasks would be that much easier or more effective if someone on the team could write shaders in Unity. I find them very complicated and scary, but I believe a video from you could really help me to get started with shaders in general.
@TheBendixSA
@TheBendixSA 6 жыл бұрын
Yeah I would love a video on getting started with shaders and shaders basics, and examples of what they can do.
@dhedarkhcustard
@dhedarkhcustard 6 жыл бұрын
You can see there's about 1 frame delay of the objects inside the portal, is there a way to fix this? It's more obvious on slower machines.
@The28studio
@The28studio 6 жыл бұрын
James Heazlewood use LateUpdate() instead of update .
@kornel7458
@kornel7458 3 жыл бұрын
unable to download shaders
@Oshibez
@Oshibez 2 жыл бұрын
ALL HAIL BRACKEYS let his vedios live forever
@jaycelee8453
@jaycelee8453 5 жыл бұрын
cannot be more thankful
@paspiregamer5114
@paspiregamer5114 6 жыл бұрын
brackeys I download your sene and at the first look all is ok but if i go on the green place and I take the portal on the wrong way i go in the red place but the portal do not work any more. Can you help me or fix this plz. And a big thank you for all your video you help me so mush :)
@jeremiebeaulieu8501
@jeremiebeaulieu8501 6 жыл бұрын
put annother plane just behind the portal, put a box colider on it and don't click on "is trigger" and disable mesh renderer ;)
@paspiregamer5114
@paspiregamer5114 6 жыл бұрын
yes I will do this if brackeys dont fix this
@bmg.rogames3551
@bmg.rogames3551 6 жыл бұрын
Brackeys I have started working on a new game and I want my players to have a level editor we’re they can make their own level like in Geometry Dash but I do not know how, can you do a tutorial on a level creator for the players?
@LettuceMuncher1
@LettuceMuncher1 6 жыл бұрын
BM.G Games - Mobile Games Great Idea hope he does it :)
@yournamegeometrydash3682
@yournamegeometrydash3682 6 жыл бұрын
Yassssssss
@ToniPlays_
@ToniPlays_ 6 жыл бұрын
Love your tutorials😍 I watch at least one video in a day. Keep it on Brackeys
@tjmorake2743
@tjmorake2743 6 жыл бұрын
You do the best tutorials i just can't stop liking your videos
@mateusnautica
@mateusnautica 4 жыл бұрын
That is great! Many thanks for the work putting it together! Any recommendations on how to port this project to VR? I implemented it as is and on my VR game and the portal has a weird looking. Each eye camera is rendering the same portal camera and the render plane gets fuzzy in the VR. I believe one has to duplicate everything and select the eye camera where it gets rendered... is that right?
@julianicolescu149
@julianicolescu149 2 жыл бұрын
Hi! I’ve been having the same issue… we’re you able to fix this somehow?
@SolarSkyStudios
@SolarSkyStudios 2 жыл бұрын
@@julianicolescu149 did you ever find a solution? I haven't tried this yet but I do know you should be using the center eye camera instead of either left or right.
@goldcobraarima9819
@goldcobraarima9819 6 жыл бұрын
Why is the depth 24?
@djpeterson7479
@djpeterson7479 5 жыл бұрын
I know this is an old comment, but for others who are wondering: it's 24-bit because it's 8-bits per channel. You have three primary channels in a texture that give you all your colors: red, green and blue. Each channel is a single byte per pixel (8 bits). So 8 * 3 = 24. If you are wondering why no alpha, probably because he's not using opacity.
@tareksalah33
@tareksalah33 6 жыл бұрын
Just in time for a VR game i'm working on ... I downloaded the other project from the original video 3 days ago and was going to decipher the code to understand how it works ... Thanks a lot Brackeys for this video
@fiend116
@fiend116 5 жыл бұрын
Did you use the oculus rift? If so how did you change the code so that it works? I can get the camera previews to look correct but the actual image that is displayed in the rift is incorrect.
@thomaslaganda4354
@thomaslaganda4354 6 жыл бұрын
Hello abjourn, I would just Like to thank you for all your help! You are the best programming tutor in the world!
@kivo3592
@kivo3592 3 жыл бұрын
is it just me or did this not work even tho i tried a million times and did exactly what he said? Just Me.
@duydoan9890
@duydoan9890 19 сағат бұрын
me too =))
@fatratstew
@fatratstew 6 жыл бұрын
Awesome tutorial! There is a bug in your shader though, it breaks when the camera is rotated on the Z-axis. How can I fix this? Thanks!
@ferna2294
@ferna2294 6 жыл бұрын
You are a genius. That quaterinion stuff code was marvelous. Thank you!
@Eclipsed_Archon
@Eclipsed_Archon 6 жыл бұрын
Wish I watched this before I went and figured it all out myself... I didn't use the shader trick, since I don't write shaders often, and since I had portals at all different angles, within one continuous level, I had to do some math to figure out the proper position and angle for my portal camera... The annoying part was realizing halfway through that my portals only looked right when rotating around a single axis, so then I had to go back and redo all my math... Then unrelated I had a dumb issue with my jump script, since I use physics based inertia, but store that starting inertia for the sake of some complex double-jump shenanigans. So when my character got forcibly rotated when moving through the portals, if they were mid jump the direction of travel would get screwed up... In the end I'm glad it was just being done as an exercise, took way too long to get it running right without any bugs. If I learned anything from this experience at all, it's never to underestimate just how much a single design choice can influence and screw you later down the road...
@H1imachicken
@H1imachicken 6 жыл бұрын
should give credit kzfaq.info/get/bejne/n66hndaUzsy0nn0.html since its the exact same layout and everything
@JayFoDra
@JayFoDra 6 жыл бұрын
Look in the description.
@H1imachicken
@H1imachicken 6 жыл бұрын
Creepiable he added that after I posted this , as I already checked before I posted
@tippinggame2799
@tippinggame2799 6 жыл бұрын
The same~OMG
@ridlr9299
@ridlr9299 4 жыл бұрын
@@tippinggame2799 is brackeys a fraud lol? :)
@WarriorH
@WarriorH 3 жыл бұрын
Does anyone know how to solve inconsistent collision detection? As it works but the colliders don't always register it.
@sosolala5080
@sosolala5080 3 жыл бұрын
Im wondering the same, mine works sometimes and then other times it doesnt :(
@phairz1168
@phairz1168 2 жыл бұрын
yea its about that the collider is very thin your pc doesnt detect it because it processes slow you probably have a bad pc u can solve this by making the collider thiccer if u know what i mean
@WarriorH
@WarriorH 2 жыл бұрын
@@phairz1168 Tried that, it kinda worked more consistently but still consistently doesnt
@phairz1168
@phairz1168 2 жыл бұрын
@@WarriorH ye it seems that u better not do that and it fully worked when u open Project Settings > physics > autosync transform (Enable) it should be smooth
@WarriorH
@WarriorH 2 жыл бұрын
@@phairz1168 thanks ill give it a go :)
@tdba316
@tdba316 6 жыл бұрын
Yes please have a series on shader writing!
@The28studio
@The28studio 6 жыл бұрын
Now if you are saying , holy crap ! What if my worlds are big ? Its simple : take a note from subnautica portals , if you didn't see em check em out . What you do is you put your portals into closed areas like caves ! This way you only load the cave on the render to texture and when the player cross the portal to the cave you start loading the new area ( or stream it )
@RKD1010
@RKD1010 6 жыл бұрын
95% of comments: Comments asking for a Shaders video 4% of comments: Vague comments asking for tutorials about something 1% of comments: Actual comments that talk about the video and are worth reading
@Thomas-wd8zm
@Thomas-wd8zm 6 жыл бұрын
Make a tutorial how to get your game on a phone
@Androidus3
@Androidus3 6 жыл бұрын
Thomas N3K has a very nice tutorial on it
@kurtisknodel
@kurtisknodel 6 жыл бұрын
File > Build Settings > Then Switch Platform to Android/iOS. You'll need to install a few things, but then it'll run.
@ChromesClips
@ChromesClips 6 жыл бұрын
Huge headache saver for people trying and failing to build to an Android. If you're having errors building don't use JDK 9, use any version of JDK 8. If problems still persist download an older version of sdk.
@magnusm4
@magnusm4 6 жыл бұрын
FUCK.PHONES! You watch fucking Brackeys with awesome tutorials of many things AND YOU WANT TO WASTE IT ON TRASH MADE BY IDIOTS WHO ONLY WANT MONEY! You have the fucking tutorials right here, make a real game instead. It's like downloading Opentoonz and just use the tools to make poor flash animations with images from MS Paint
@Dxpress_
@Dxpress_ 6 жыл бұрын
*+magnusm4* Chill out dude. It's not like you can't do both. Edit: Also, Brakeys has done streams on how to create various mobile games.
@pierrethehandsome2518
@pierrethehandsome2518 6 жыл бұрын
You've earned yourself a subscriber! This technique worked very well and I learned a lot more about quaternions while following along. I was even able to create an infinite corridor effect in addition to a portal by altering the portalteleporter script. Your videos are very high quality and you explain things properly and concisely. A tutorial on shaders would be nice as that sort of stuff is like ancient atlantean to me.
@heroblender
@heroblender 7 ай бұрын
thanks for hauling me through my game production course
@explogeek
@explogeek 4 жыл бұрын
“It’s simple, just use the file I made”. Kind of defeats the purpose, if you’re not showing how to make this from scratch...
@SafaAlkan
@SafaAlkan 4 жыл бұрын
Thanks man! Now ı can use portal in my game and that looks cool ;)
@raz3743
@raz3743 6 жыл бұрын
You can not believe in how good time you did this video
@pederslothzuricho7685
@pederslothzuricho7685 3 жыл бұрын
The transport and rotation of player can be simplified in complexity by using quaternions directly instead of casting to angles. It will be a bit cleaner but also confusing for people who are used to thinking of angles as degrees rather than algebraic lenth. I suspect you can abuse lerp and transform definitions to skip the dotP too, as the result of the lerp will have the same properties as the dotP. q1 to q2 is the same as q2 to q1 this means you can just check if the lerp result is small enough. Because the maximum result is discarded, the minimum result will always be less than or equals to half a revolution; so if its less than lets say a quarter revolution you know its entering from the correct direction. Now this lerp itself is the Quaternion rotation you need to apply when rotating the player, so no need to cast to euler angles, all you need to do is set the Transform = receiving tansform and apply the lerp. Its something like 4-6 lines of code less. And it is fewer calls and cheaper math overall. If you experience fps stutters on tp, you can try this. Not that i think that is common, but the less time you need to complete the tp, the less strain it is on the cpu. If someone tries both please let me know if you could detect a performance difference. I dont have a portal game in works atm.
@pederslothzuricho7685
@pederslothzuricho7685 3 жыл бұрын
if its confusing you can read: en.wikipedia.org/wiki/Slerp#Quaternion_Slerp
@pederslothzuricho7685
@pederslothzuricho7685 3 жыл бұрын
13:00 you will have a problem with changing resolution ingame, if you dont add an interface or eventsystem to register and hook the operation when the resolution is changed. :)
@ashdotpy
@ashdotpy Жыл бұрын
if anyone is having issues, I removed the if (playerIsOverlapping) from Update to it's own call and then just called that class when the player entered the trigger. Example: void Portal() is the new class with all of the code from update in it, minus the if (playerIsOverlapping) line. Then in OnTriggerEnter I call Portal() when other.tag == "Player' triggers it
@Hamstermoviespro
@Hamstermoviespro 6 жыл бұрын
Render Textures and Shaders are super powerful elements, please do a video explaining how they work!
@2dinunity10
@2dinunity10 6 жыл бұрын
This is sweet! Kind of similar to the 2d portal tutorial made. I also wrote a shader that ripples the portal view which adds a nice effect
@1e1001
@1e1001 5 жыл бұрын
If you have a camera that renders only some elements placed on the player camera, and add the shader and material and stuff, you can make an object that hides objects behind it. I used this for some projects to hide map objects that I don't want to see for windows and stuff
@marian519
@marian519 6 жыл бұрын
This approach will render things that are behind the portal in the other world, which you shouldn't see. Maybe this could be fixed with a replacement shader or by changing the clipping plane.
@jx4219
@jx4219 6 жыл бұрын
So that's how easy it is. I was searching for this everywhere like ~2 years ago and the only thing i found was a portal you could look trough but then just teleports you when you walk trough it and not let you walk trough it seamlessly. I thought it's just not possible yet but it seems to be rather simple.
@yangli7230
@yangli7230 3 жыл бұрын
Will you try to replecate Sebastian Lague's perfect portal?
OBJECT POOLING in Unity
17:23
Brackeys
Рет қаралды 430 М.
How were the portals in Portal created? | Bitwise
8:28
DigiDigger
Рет қаралды 1 МЛН
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Wian
Рет қаралды 5 МЛН
7 Days Stranded In A Cave
17:59
MrBeast
Рет қаралды 94 МЛН
What will he say ? 😱 #smarthome #cleaning #homecleaning #gadgets
01:00
Nurse's Mission: Bringing Joy to Young Lives #shorts
00:17
Fabiosa Stories
Рет қаралды 3,3 МЛН
Coding Adventure: Portals
16:06
Sebastian Lague
Рет қаралды 1,3 МЛН
Brackeys Game Jam 2020.2 - BEST GAMES!
11:31
Brackeys
Рет қаралды 544 М.
I Made Portal 3 Because Valve Wouldn't
8:53
CodyCantEatThis
Рет қаралды 2,9 МЛН
A new way to generate worlds (stitched WFC)
10:51
Watt Designs
Рет қаралды 525 М.
I Paid Fiverr Game Developers to Make the Same Game
10:25
BadGameDev
Рет қаралды 677 М.
I Spent 100 HOURS Making a Game With NO GAME ENGINE
13:42
Fuelvin
Рет қаралды 338 М.
Fully Functional Portals in Unity URP
18:26
Daniel Ilett
Рет қаралды 47 М.
How do non-euclidean games work? | Bitwise
14:19
DigiDigger
Рет қаралды 2,4 МЛН
The Future of Game Development
8:58
Brackeys
Рет қаралды 1,2 МЛН
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Wian
Рет қаралды 5 МЛН