How were the portals in Portal Game created?

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ม.ค. 2025

ความคิดเห็น • 64

  • @Proghix
    @Proghix 3 ปีที่แล้ว +51

    Dude, this is amazing! So well explained, so well thought! Awesome work and awesome video, love it! :)

  • @johadelet4826
    @johadelet4826 2 ปีที่แล้ว +26

    Always wondered how they made this work, i thought the game rendered a new room everytime

    • @MystCraft24
      @MystCraft24 5 หลายเดือนก่อน +3

      i thought of it too but then i thought no way it could do that, the amount of lag while doing portal jumps would be insane

  • @jmispace
    @jmispace 3 ปีที่แล้ว +11

    Very well done! Very clearly broken down and explained, issue by issue!

  • @unityin1minute962
    @unityin1minute962  3 ปีที่แล้ว +17

    I will upload the source code soon, just re-organizing the codes a bit :)

    • @saltix0
      @saltix0 3 ปีที่แล้ว +3

      I'm currently trying to make a VR game with portals so seeing the non-VR implementation would really help!

    • @ronen6206
      @ronen6206 3 ปีที่แล้ว +2

      Will we need to set something other than the script (like a Shader)

    • @unityin1minute962
      @unityin1minute962  3 ปีที่แล้ว +2

      Yes, you will have to set up shader in order for the camera to render only part of the whole frame :)

    • @Itay_Ron
      @Itay_Ron 3 ปีที่แล้ว +2

      @@unityin1minute962 Will you give us the shader?

    • @unityin1minute962
      @unityin1minute962  3 ปีที่แล้ว

      @@Itay_Ron Yes, very soon. I am a bit busy so that's why I have not uploaded the project yet :)

  • @369Sigma
    @369Sigma 2 ปีที่แล้ว +9

    Good explanation. Crazy to think such a seemingly magical effect is just a bunch of camera and collision tricks

  • @3KLANGMUSIC
    @3KLANGMUSIC 10 หลายเดือนก่อน +2

    There is a mistake at 1:10. You described your code implementation as if the portal-cameras rotation angle depends on the players relative angle to the normal vector of the portal, but actually you implemented it in the way, that the portal-cameras rotation angle depends on the player-cameras rotation angle.

  • @joshuaokokpujie1521
    @joshuaokokpujie1521 2 ปีที่แล้ว +1

    I love this so much. I was stuck when it came to creating a portal like that, it just didn't make sense until i cam across your video. It is helping me create a portal step by step, thanks c:

  • @lucii5022
    @lucii5022 ปีที่แล้ว +1

    This video is a really big help, and the way you explained it was amazing. Thank you! :D

  • @kjIbacon
    @kjIbacon ปีที่แล้ว +3

    I always thought it was a complicated mechanic. When it was actually a series of simple mechanics that was sewn together which resulted to that seamless outcome. The problem solving skills of devs are really amazing in this regard. Truly masters of deception, in a sense. Hahaha

  • @RivenbladeS
    @RivenbladeS 9 หลายเดือนก่อน +1

    I wish you showed us the clipping of the whole screen to a small rectangle, the math behind or shaders

  • @matthewvarpness8765
    @matthewvarpness8765 3 ปีที่แล้ว +4

    Amazing video and really well explained! Thank you for sharing your knowledge and experience!

  • @davids3282
    @davids3282 3 ปีที่แล้ว +4

    Really liked this video. Good job!

  • @Seestral
    @Seestral 3 ปีที่แล้ว +5

    i'm still learning so I don't understand the code perfectly but this was a very interesting watch

    • @unityin1minute962
      @unityin1minute962  3 ปีที่แล้ว +2

      Thanks. Once you will get used to unity and game dev related coding, then it's not very difficult to do :)

  • @MrMinticuz
    @MrMinticuz 3 ปีที่แล้ว +6

    Really good tutorial. Do you know how the collision of the wall is altered depending on the portal position? You can’t walk through a wall, but when there is a portal there, there is no collision in that specific area. Any idea how that is achieved?

    • @unityin1minute962
      @unityin1minute962  3 ปีที่แล้ว +3

      There is a trigger right in front of the portal which moves the player from one part of the portal to the other. So, when the player moves towards the portal, it never collides with the wall collider because the player hits the trigger first and then the position of the player is changed to the other part of the portal in a smooth way. So it seems that the player is crossing the portal through a hollow wall but in reality, trigger is changing the position of the player to the other part of the portal smoothly.

    • @MrMinticuz
      @MrMinticuz 3 ปีที่แล้ว +1

      @@unityin1minute962 oh, hmm. That’s cool, but I get the triggers moving the player position when the player has moved halfway through the portal, but you can’t do that incrementally.
      So I still don’t get it how it does that

    • @genericobjectshow3440
      @genericobjectshow3440 ปีที่แล้ว +1

      @@MrMinticuz I figured out a way to do it in Godot Engine.
      Basically, using the shape, you can basically cut a hole in another object using a CSG shape. This is for Godot 3 only :/

    • @MrMinticuz
      @MrMinticuz ปีที่แล้ว

      oh that's actually dope, great to know man@@genericobjectshow3440

    • @randomcatdude
      @randomcatdude 6 หลายเดือนก่อน

      @@unityin1minute962 this is not correct. if this were the case, you wouldn't be able to stand inside a portal.
      the portal games actually create a copy of the nearby collision and cut a hole into it. then any objects close to the portal will only collide with this copy, rather than the actual map collision

  • @fallenhoenix1255
    @fallenhoenix1255 3 ปีที่แล้ว +4

    Wonderful tutorial! Thank you for the dot product explanation too... But one gaping hole in my understanding is how to handle collisions. Is the portal offset from the wall? Is there some sort of masking wizardry going on here??

    • @birdlegscass
      @birdlegscass ปีที่แล้ว

      anything in contact with the portal should ignore the collision of the wall and instead respect a rectangle of collision surrounding the portal

  • @axewhite6553
    @axewhite6553 3 ปีที่แล้ว +1

    I knew how it was made but i still wanted to watch the video

  • @TaelsDoll
    @TaelsDoll ปีที่แล้ว

    excellent

  • @yarriksauker993
    @yarriksauker993 5 หลายเดือนก่อน

    thank you so much, this video made me able to build a tardis

  • @EthereanOriginal
    @EthereanOriginal 2 ปีที่แล้ว +1

    Do u have a Github where this project can be found? Thanks.

  • @impokie_969
    @impokie_969 11 หลายเดือนก่อน

    is there a way to do this without a shader?

  • @FriesOnYt
    @FriesOnYt 2 ปีที่แล้ว

    Hey can you make this but all 4 walls are portals so the room is infinite?

  • @frogtheneonsaber
    @frogtheneonsaber ปีที่แล้ว

    I doubt you will find this but if you do ill tell you how the game renders an object. It renders the covered mesh on the otherside

  • @llIIllIlIIllX_XIillIIllIIllIll
    @llIIllIlIIllX_XIillIIllIIllIll ปีที่แล้ว

    do you have the project on github to try it ourselves?

  • @muhammadzubairirshad6724
    @muhammadzubairirshad6724 2 ปีที่แล้ว

    You are Just Amazing Dude

  • @maxherrmann1182
    @maxherrmann1182 2 ปีที่แล้ว

    Why did you stop making videos? They're amazing!

  • @jigarpanchal0
    @jigarpanchal0 2 ปีที่แล้ว

    Bro why aren't uploding videos

  • @pantsurevolution
    @pantsurevolution 2 ปีที่แล้ว

    great job

  • @bigmancozmo
    @bigmancozmo 2 ปีที่แล้ว

    Channel: "Unity in 1 minute"
    Video length: 5:08

  • @Windder
    @Windder 23 วันที่ผ่านมา

    Anyone here after playing Marvel Rivals?

  • @ShatabdaRoy115
    @ShatabdaRoy115 2 ปีที่แล้ว

    fantastic

  • @Dallas4090
    @Dallas4090 ปีที่แล้ว

    This just blew my mind. Fuck.

  • @TurboMintyFresh
    @TurboMintyFresh 2 หลายเดือนก่อน

    Geniuses at valve

  • @exploringabandonedhauntedo6589
    @exploringabandonedhauntedo6589 3 ปีที่แล้ว

    I think you forgot to post a new video

  • @diegogame1213FR
    @diegogame1213FR 7 หลายเดือนก่อน

    i still don't get the math help

  • @SS-pm3px
    @SS-pm3px 4 หลายเดือนก่อน

    Please share the source code

  • @BastienStudio
    @BastienStudio 3 ปีที่แล้ว +1

    Pretty cool but there's a lot of things you forgotten :
    -The portal can be placed on white walls but not on black ones
    -Is the momentum preserved between the portals? (players and object)
    -Can we shoot portals ? (cuz they are on the wall when you start the game)
    -Is there some particles that can make the portals more realistic ?
    -If we do a co-op game, all the players can go through portals, shoot different portals and others things like this ?
    Otherwise the video is great, I can't wait to have the code to use it :D

  • @tcritt
    @tcritt 9 หลายเดือนก่อน

    You ripped this off from another channel. Tsk tsk.