Part 8 - Zelda-like Room Transitions: Make a game like Zelda using Unity and C#

Поделиться
HTML-код
  • Опубликовано: 18 ноя 2024

Комментарии • 357

  • @BandDBricks
    @BandDBricks 4 месяца назад +4

    I know I'm five years too late but if you still check this channel thank you so much! You make everything so much less complicated than any other tutorial type video I've seen, and this series is literally a godsend.

    • @SuperTacoDude27
      @SuperTacoDude27 4 месяца назад

      Did the CameraMovement part work for you? it keeps giving me an error

    • @SuperTacoDude27
      @SuperTacoDude27 4 месяца назад +1

      nvm I fixed my mistake

    • @BandDBricks
      @BandDBricks 4 месяца назад

      ​@@SuperTacoDude27 glad to hear it, I think this series is somewhat out of date now some of the stuff isn't perfect

  • @henrrypoop7570
    @henrrypoop7570 4 года назад +105

    wat a legend recording on 8% battery

    • @mckaylam1171
      @mckaylam1171 3 года назад +5

      i was checking the battery level constantly while watching this video lol

  • @t0tzky_
    @t0tzky_ 4 года назад +62

    Ok so no one is talking about that epic unedited "Hey there I'm almost done" *slam* at 13:07

    • @thecuchikiller
      @thecuchikiller 4 года назад +26

      "Are you winning son?"

    • @t0tzky_
      @t0tzky_ 4 года назад +1

      @@thecuchikiller xD!!!

    • @xingorro8605
      @xingorro8605 4 года назад +1

      First time i heard it i tought ??? what was it??

    • @mrraspberry8263
      @mrraspberry8263 4 года назад +1

      He's taking a shit haha

  • @pixelsdontmove
    @pixelsdontmove 6 лет назад +67

    Thank you from Norway, I've learned more from your videos the last week than I have with 100's of random Unity tutorials the last year. Have a great day!

    • @MisterTaftCreates
      @MisterTaftCreates  6 лет назад +12

      Ha, you're too kind! Thank you very much for your compliment!

    • @elijahvalongo9528
      @elijahvalongo9528 4 года назад

      jeg elsker deg

    • @itotallyagreewithyou3451
      @itotallyagreewithyou3451 3 года назад +1

      @@MisterTaftCreates Thank you from Sweden! But it's important that you don't help the Norwegians though^^

    • @alex-five1917
      @alex-five1917 3 года назад +1

      @@itotallyagreewithyou3451 well hello from Denmark and you shouldn't get too much help from this legend either ^^
      (btw it's a joke =) have a nice day stranger)

    • @GhastCraftHD
      @GhastCraftHD 2 года назад +1

      @@itotallyagreewithyou3451 Don't underestimate us norwegians!

  • @PatrickMoening
    @PatrickMoening 4 года назад +13

    For non-square rooms I instead of using += I just used =. This way I just set my bounds for each room. Another thing I was thinking of doing is having another object that surrounds the room, then making the camera bounds only equal to that. Either way this video is great for introducing uses for scripts within box colliders.

  • @tyler5580
    @tyler5580 5 лет назад +4

    I know you probably hear this a lot, but these tutorials are the best I have found yet. Using these tutorials, I am able to recreate an old game from my childhood but with the improvements that I always imagined it needed. The way you describe what you are doing makes this seem so easy to understand.

  • @andymartin1574
    @andymartin1574 3 года назад +3

    I've been programming computers for 20 years. This series of videos is by far the best tutorial of any programming task I've ever seen. Well done, and thank you so much for making this.

  • @olympianfire4770
    @olympianfire4770 5 лет назад +40

    I was wondering, will you be making a quest system?

  • @vickyxx197
    @vickyxx197 3 года назад +3

    I've been binch-watching your videos for the past few days. Already learned more than I have from the past 3 months of (what feels like) endless of Unity and C# tutorials. I'm making my first game for my fiancé to play and finally, I feel like I've gone from turning slightly insane to actually understand what I'm doing. Thanks, tack, from Sweden

  • @FatMorton
    @FatMorton 4 года назад +5

    Btw an alternative is something like:
    minPosition = new Vector2(Mathf.Floor(target.position.x / 25) * 25 + 6.666f, Mathf.Ceil(target.position.y / 25)*25 - 20);
    maxPosition = new Vector2(Mathf.Floor(target.position.x / 25)*25+18.335f, Mathf.Ceil(target.position.y / 25) * 25 - 5);
    I personally like this method more because the player doesn't teleport. The only downside is that every room has to be the same size

    • @curcobane2442
      @curcobane2442 4 года назад +2

      You could create a new variable to assign the new maximum and minimum position of the camera, worked pretty well for me, and worked well for non square rooms. All i did was:
      cam.MinPos.x = newMinpos.x;
      cam.MinPos.y = newMinpos.y;
      cam.MaxPos.x = newMaxPos.x;
      cam.MaxPos.y = newMaxPos.y;

  • @daamosrs7515
    @daamosrs7515 3 года назад +5

    Sorry if its already been mentioned but to reduce the amount of objects you need for room transitions, you can add a bool that flips when you go in and just have the code do the opposite when you hit the same trigger. like this:
    if (other.CompareTag("Player") && TriggeredOnce == false)
    {
    cam.MinPosition += MincameraChange;
    cam.MaxPosition += MaxcameraChange;
    other.transform.position += playerChange;
    TriggeredOnce = true;
    }else if (other.CompareTag("Player") && TriggeredOnce == true)
    {
    cam.MinPosition -= MincameraChange;
    cam.MaxPosition -= MaxcameraChange;
    other.transform.position -= playerChange;
    TriggeredOnce = false;
    }

    • @alternatecheems8145
      @alternatecheems8145 Год назад

      Just use tilemap 2d and tilemap collider as a trigger and do the same thing as he did

  • @JohnTitorrrrrr
    @JohnTitorrrrrr 5 лет назад +1

    This tutorial is really easy to follow and covers so much content! Thanks so much. It has really got me interested in unity development, this is the perfect place to start! Honestly have no idea why this isn't more popular

    • @MisterTaftCreates
      @MisterTaftCreates  5 лет назад

      Thanks so much! This tutorial series is definitely a work in progress so forgive any bumps along the way :)

  • @Born2DoubleUp
    @Born2DoubleUp 5 лет назад +4

    It works like a charm. I'm still learning so much from each video. Thanks again for creating these!

  • @alonbendavid7590
    @alonbendavid7590 5 лет назад +8

    I cant tell how good you're tutorials are, thank you so much, maybe one day I will publish my own game :D

  • @junki5639
    @junki5639 4 года назад +3

    You are a legend! I miss school, this is great!

  • @chendaniel9831
    @chendaniel9831 4 года назад

    Hello there
    Mister Taft Creates!
    I gotta show you support and love for making this series and keeping it up until this day! from all the tutorials out there including very big famous unity youtubers you are by far the one i got hooked to, seriously this is the first thing i do after i get back home from work!
    i intend to finish your tutorial i am really expecting to reach the upcoming parts!
    I have a slight suggestion for this camera movement part here, it is more of a "taste and feel" kinda suggestion and i would very much appreciate if you could responde to it and give your thought!
    i found that for my eye it felt kinda weird that when the camera travels up to the new room it stills shows some part of the lower room, (again, for my taste) so i changed the parameters on the "Room Move" script from "Camera Change" to be 2 parameters: cameraMinChange and cameraMaxChange.
    The cameraMaxChange still holds the same value 25 on Y axis but the cameraMinChange holds a higher value 27 on Y axis which results in the camera moving even more up aligning itself so that the lower part of it fits exactly with the lower border of the room.
    i would very much appreciate your thoughts on that!
    Again thank you so much for taking the time and patience in making this videos! already subscribed liked and shared your videos and channel, keep up the good work and the calming and humble attitude!
    Cheers

  • @reszzz
    @reszzz 5 лет назад +3

    Wow just when I thought this was going to be the hardest thing yet, it was very simple and you made it very easy to understhand. Thanks!

    • @MisterTaftCreates
      @MisterTaftCreates  5 лет назад

      Thanks! I end up doing this another way later in the series that is even simpler. If you want to jump ahead to the videos titled Observer Objects and Cinemachine Cameras, you can see how to do that.

  • @HarriForUnity
    @HarriForUnity 6 месяцев назад +1

    my bounding boxes on my camera are broken when going to the next room can you help me?

  • @adankhan1103
    @adankhan1103 4 года назад +2

    i made my stuff pretty nice the transitions look pretty good too but my camera stopped following my player? is there anything wrong that i have done.pls help

  • @pedrobraga4944
    @pedrobraga4944 3 года назад +2

    Amazing playlist! Thanks a lot for the video.
    I am currently developing a pixel art game in Unity that takes place in a house. So I need transtions between rooms. In addition, some rooms are going to have top-down view and others side-scroller.
    Do you think the best approach for this case is each room be a scene? Or to have many rooms inside only one scene?

  • @RyuBateson218
    @RyuBateson218 2 года назад

    Thanks for making this serie.

  • @LiamR90
    @LiamR90 4 года назад +1

    So I've made another tilemap. All done on Unity.
    I don't know how to select all of the grids and call it a new Tilemap, I just have the one "Grid".
    I want the tile maps to be "Cross Roads" and "Beach" where yours a room 2 and overworld.

  • @noahfeazell3336
    @noahfeazell3336 5 лет назад +4

    How do I separate rooms when I'm using Unity's tilemap editor? It's just one big ground. How do I define the second room as a second room?

    • @foodmixic1503
      @foodmixic1503 5 лет назад +1

      Go to 2D and select Create Tilemap

    • @felixandersen424
      @felixandersen424 4 года назад

      have you found the solutions yet? :(( i also encounter the same problem...

  • @DavidMauas
    @DavidMauas 5 лет назад +4

    Hey Mr.Taft
    I'm having a scale issue - well, several issues actually
    1st, since I continued my tilemaps (collision & ground) both in unity, I'm not sure how, or even if I should, separate the rooms to different objects. I'm sure this has a benefit, in terms of keeping things ordered. How would you suggest this be done?
    2nd - and this is not an issue right now - but I have a strong gut feeling this is gonna come up definitely in the near future: I noticed, when I created the RoomTransfer object, that my scales are way different than yours, for some reason unknown to me
    I used 16 PPU when importing sprites, just as you did
    but the scale of my objects - all objects in fact - is 1, 1, 1
    camera, player, grid, tilemaps, everyhing in my project is 1,1,1
    and the gameobject "roomtransfer" appears huge in my project for some reason - whereas yours appears very small
    so I check out the scale in your project and noticed that your grid and other object are at 0.065 or something like that
    my question is:
    what *should* the scales be?
    how do I make sure, in the beginning, when it's still easy to control, that the scales are set right, and don't bite me back sometime in the future?

    • @MisterTaftCreates
      @MisterTaftCreates  5 лет назад

      Your scale should be 1, 1, 1 - in case you want to manipulate that later. I didn't think that happened to my scales. I'll have to look later today.

    • @DavidMauas
      @DavidMauas 5 лет назад

      @@MisterTaftCreates I'm learning so much from just following these videos. One of the notes I jotted down is to make certain in future projects to know my scale and positioning in advance. I'm not 100% certain I caught your scale numbers right when rewinding the videos. However more differences rose as I was implementing the place name - mine, in spite of being setup just like yours, ended up much more square'ish for some reason. Maybe my mac's resolution and screen aspect ratio played a part here. Not sure yet.

    • @thaddeuskent8185
      @thaddeuskent8185 5 лет назад +2

      Thank you for asking this.

  • @irtizashayer
    @irtizashayer 5 лет назад +1

    So my rooms are not square and equal shape and I am awfully stuck, would appreciate much if u could help

  • @Xerenas
    @Xerenas 4 года назад +6

    so my camera is fine but when i transition into a new map it doesnt have boundaries. help :(

    • @breaker19ist
      @breaker19ist 4 года назад

      same and my room is taller on y and longer on x than my original

    • @ozonichi
      @ozonichi 4 года назад +2

      @@breaker19ist Did you fix it?

    • @breaker19ist
      @breaker19ist 4 года назад +2

      @@ozonichi kinda if you scroll through the playlists there is a FAQ video where he addresses questions that get asked quite a bit

    • @ozonichi
      @ozonichi 4 года назад

      @@breaker19ist thanks I got it.
      I changed y values for x values when clamping

  • @gvan11ian
    @gvan11ian 3 месяца назад

    8:45 i don't understand what you mean by i'll need 2 different vectors
    idk what to put for them, my other rooms aren't the same shape
    I'm trying to get the camera to move past the screen transition and continue following the player, but it stops too soon

  • @cjgillum5417
    @cjgillum5417 3 года назад +1

    instead of making the one Room Transfer into a Prefab i made an empty game object a parent of both Room transfer triggers.
    Then making that empty game object with the 2 Transfer triggers a child of it into a Prefab. that way when you grab the Prefab you are grabbing both Transfers in one object and can rotate it and scale it as you need it and will edit the orientation of both triggers at same time by scaling and rotating the parent object.

  • @Beunibster
    @Beunibster 5 лет назад +2

    Could you make a simple version of the Unity project available for download?

  • @happymago1
    @happymago1 5 лет назад +1

    How do we do that withouts using a tiled map? Cuase i cant seem to make the map i made with unity an object like the tile map you made with tiled

  • @timartin
    @timartin Год назад

    When I add the script the public variables Camera Change and Player Change aren't visible in the inspector and I get the compiler error CS0034: Operator '+=' is ambiguous on operands of type 'Vector3' and 'Vector2'
    I followed the code exactly so any insight here? First hangup so far the tuts have been incredible!

  • @xXIce__BlastXx
    @xXIce__BlastXx 4 года назад +1

    Hey loving the videos but have a question how can i setup the camara bonding for other size maps/rooms or is this not possable IE.. first map max is x25, y5 - min x-25 y-5 then switch to a new room with smaller bonding hope that makes some sence

  • @rcc4160
    @rcc4160 4 года назад +2

    Hey I know I'm a bit late but I'm following all your videos up to this point and it's been super helpful !!! But I'm having a problem , when I go through the room transfer and brings my character to the next area and if I making my character go back through room transfer 2 it brings me back to the starting area , so all that is working
    The problem I have is when I go into the second area the camera doesnt so the same thing as yours, I'm able to see the starting area in the second area . And it also doesn't go all the way up to the top there's like the border we had in the starting area. Sorry if that was long and confusing but it's a bit of a weird problem :/

    • @DoubleBuild
      @DoubleBuild 4 года назад

      Me too if u resolved that problem can u help me please?

  • @bran8370
    @bran8370 6 лет назад +1

    Amazing! Love it! Works beautifully.

  • @adamsyed7540
    @adamsyed7540 4 года назад +6

    Hi everyone, I've started to implement some of the elements from your videos into my project and I was wondering if doing this specific room transition is possible without using tiled? Can I do it by just having different sections of my tilemap and have separate boundaries? Thanks and great job on your videos!

    • @MisterTaftCreates
      @MisterTaftCreates  4 года назад +3

      That's totally doable. Later in the series I show an even easier way to do this. The videos are Observer Objects, and Cinemachine Cameras. Those videos go over a very simple way to do this with any object

    • @nightcoredragun3419
      @nightcoredragun3419 4 года назад

      hi. what did you put to the script for camera? i dont know how to make it change for a room to another. i'm french sow i try to laern what you do sow if you can give my explicity details that cool. Thx

  • @ImKyleConway
    @ImKyleConway 4 года назад +1

    Edited: Had some trouble with the trigger freaking out when slowly stepping in to it. It turns out it was caused by having multiple colliders on my player. This also made the triggers push me twice as far as it did once I deactivated one. Now it works fine

  • @yeah1727
    @yeah1727 5 лет назад +1

    Thank you for lessons again!can you help me,i have got trouble,I see the borders of objects,what can i do?,i think i missed some info in videos.

  • @KanyeWarRoom
    @KanyeWarRoom 4 года назад

    This is sick.

  • @talhahussain4469
    @talhahussain4469 Год назад

    You are so underrated ❤❤nice videos

  • @sgtfoose8842
    @sgtfoose8842 4 года назад

    Question, I sticked with the Unitity Tilemap since in video 10 you are going to show a fix for the ugly seems. Thing is that when I select my Room 1 > Collision layer (which I made 30x30) shows a rectangle square with a white outline and blue dots on every corner with a different size (47x30)? It looks to me that my Collision is now overlapping the collision of Room 2? Were can I change the size of my Collison layer because if I take the blue dot and squise my rectangle, it is going to Scale it, not resize the Collision layer?

  • @jseneque
    @jseneque 5 лет назад

    Awesome, another feature you make so easy

  • @smoochkirby4951
    @smoochkirby4951 4 года назад +1

    what is the code for the not square room to change the camera angle

  • @chemicalratt939
    @chemicalratt939 4 года назад +1

    Would it be a viable option to add a "switch" bool variable to the Room Transfer class, so that on enter you add the changes and toggle the switch, on enter again you subtract changes and toggle? I tried this, and it works, and it removes the need to move the player forward at all.

    • @lt.cloptin4128
      @lt.cloptin4128 4 года назад

      Could I get that added code?
      Having a problem with the camera collider with the end of the map not working, everytime i walk near the edge it doesnt stop, just shows grey

  • @thaddeuskent8185
    @thaddeuskent8185 5 лет назад +2

    For some reason I am stuck in the beginning of the video. Someone help? I made everything via the ground tilemap and the collision tilemap, so how would I create a "Room 2" Tilemap but still use the properties of the ground and collision maps? Isn't it a separate asset in the tilemap? Does that mean I would have to create this new room with its' own ground and collision maps and repeat the process every time there I creat a new room? I was making it more tiles and rooms all with the same "Ground" and "Collision" units I have in the Hierarchy. Halp.

    • @amandag2053
      @amandag2053 5 лет назад +1

      Hey, I have almost no idea what I'm doing, but I think if you create a new tilemap for room 2, you can just copy and paste the collision and ground objects from your hierarchy list and paste them under the new one. I just did that, and the collision one has the colliders and such we added the first time on it. Although I suppose you can just rename the tilemap it imports under the grid to Ground, since as i recall we didn't do anything special to it. I hope this helps you until someone smarter comes around. I can't test if placing things on the new collision grid makes it have collision or not, because I still havent figured out room transfers and moving the damn camera there. So...Take that for what you will.

    • @thaddeuskent8185
      @thaddeuskent8185 5 лет назад

      How I did t think of this is beyond me. You’re killer. ♥️ thank you.

    • @amandag2053
      @amandag2053 5 лет назад +1

      I got it working, the new room does get the collision we made when you just copy paste the collision object we made in the previous lesson. So you don't have to manually set it up everytime. You can even make it a prefab for later. So that is a solution, I think.

    • @thaddeuskent8185
      @thaddeuskent8185 5 лет назад

      Amanda Sampson you’reeeeee the best.

  • @TheTerspet
    @TheTerspet Год назад

    i am using unity build in tilemapping stuff, and i have one mega level sofar where i have basicly multiple rooms, but different sizes, all are on the same grid though, how would i have to change the script so that it works like it does for you? i am asking because i only started this unity journey end of january and i dont know much yet, would be realy nice of you to let me know :)

  • @OrthodoxBrethren3
    @OrthodoxBrethren3 2 года назад +1

    idk why but its not working at all
    it compiled fine and there were no errors but it doesnt work
    if anyone knows why please help me

  • @sharkdude2018
    @sharkdude2018 5 лет назад +2

    Error CS1061: ‘Vector2’ does not contain a definition for ‘main’ and no accepting a first argument of the ‘Vector2’ could be found (are you missing a using directive or an assembly reference?)

  • @thethirdeyesociety
    @thethirdeyesociety 3 года назад

    Im having an issue with my camera jumping back to the player start position when I start walking forward but the camera follows when i go left and right. please help me lol

  • @danielcjtodd
    @danielcjtodd 5 лет назад +1

    So how would you create the forest maze in Zelda 1 with this method? Rather than coding coordinates and locking them to those numbers, could you use the room name and its boundaries to define the camera? This way you could change the room later, or it’s position?

    • @MisterTaftCreates
      @MisterTaftCreates  5 лет назад

      You can do that, or you can dynamically load different rooms when you exit one. For example, put a trigger on the left side, and when you enter that zone, it recreates a specific room, but a different one on the right side of that room. If that makes sense.

  • @SpoonsDebonair
    @SpoonsDebonair Год назад

    How would you divorce the screen transition from the camera smoothing? Like if for example you wanted the transition to be half the speed it currently is without changing the smoothing to avoid stuttering? Or is this covered in a later episode?

  • @MostBronzeChunner
    @MostBronzeChunner 3 года назад

    Hmm? Operator '+=' is ambiguous of type Vector3 and Vector2... I'm not getting the Change Camera and Change Player bit on the added component even though the script is exactly the same (I'm running Unity 2020 and Visual Studio 1.58).

  • @youtuberyoutuber2495
    @youtuberyoutuber2495 3 года назад

    I followed exactly and my character transitions to the next room as soon as the camera itself touches the box collider instead of the character having to touch it. How do I fix that?

  • @misterchibi5707
    @misterchibi5707 5 лет назад +2

    i don't know why after putting the script in Room Transfer , it doesn't show me the two objects Camera Change and Player Change

    • @Loris78
      @Loris78 3 года назад

      are they private or public?

    • @MostBronzeChunner
      @MostBronzeChunner 3 года назад

      I know your comment is 2 years old but I'm currently following this tutorial and am having the same issue. My script is exactly the same but when I add the Room Transfer script as a component it doesn't show Camera Change or Player Change.

  • @TheAwesomeAlan
    @TheAwesomeAlan 3 года назад

    It's okay to skip this if I want something more open world-y right? I wouldn't be using room transitions so I just want to be sure.

  • @frankthemonke6743
    @frankthemonke6743 5 лет назад +2

    When i change the smoothing my camera starts shaking, so how can i change the smoothing without getting a shaking camera?

    • @SuperVini310
      @SuperVini310 5 лет назад

      The camera shakes because the player is stepping on both "room transfers" at the same time. Try to increase the player position (if it's 2, make it 4).

  • @Wilconfs
    @Wilconfs 5 лет назад

    Oye amigo yo quiero que cuando cambie a la otra escena cambie tambien el minimo y maximo de la camara ya que la otra escena es mas pequeña o grande,depende, tienes alguna solucion para eso Gracias

  • @xxbergxx
    @xxbergxx 4 года назад

    man im struggling here bro not anything to do with you or the script i think but my first roomtransfer works perfectly and so does the transition back, but when i used the prefab to transfer to another room the camera jumps like double the distance then when i try to walk the player to the camera like 8 units away the camera jumps back to the other room??? super strange

  • @elijahvalongo9528
    @elijahvalongo9528 4 года назад

    also bro I realized that in the unity tile map editor yes it does end up makign the player jerk forward but that was before I put the tilemap above the camera in the scene, and the jerkiness stopped. are there any unwanted consequences from doing that or should i really just stick to Tiled Editor to avoid the jerkiness, I ask because I had a bit of an issue importing the tile map from tiled2unity, because it had 3 layers, game object, collision, and ground, and when i dragged the prefab into the scene it allowed me to drag it but nothing appeared, I had to drag in the individual meshes of the layers from the mesh folder, and fiddle around with the sequence in the scene heirarchy for it to even render the collision layer, and half the time it just wouldnt work and would make the play test button inaccesible for some reason. thanks man from nyc this has been my dream since i was 7 years old and you, you!!!! are making it possible god bless

  • @baileyflathersguitar
    @baileyflathersguitar 2 года назад

    My room is the exact same size as last one, only difference was I went to the right. Now I'm running into a problem where the camera only wants to go half way to the right of the room instead of its full width do you have any suggestions for what I do?

  • @yeggi6739
    @yeggi6739 5 лет назад

    So I try to import a second tiled map to follow this transition tutorial but it gives me an error in unity when I try to import it. 'The object you are trying to replace does not exist or is not a Prefab'. How do I combat this?

  • @nadhirahrozhi5425
    @nadhirahrozhi5425 4 года назад

    previously there is no Tiled Map (script) for the room 1..is it necessary and how did you add it??plus how did you manage to name the room i mean do separate section of rooms (overworld and room 2) okay i totally lost lol..someone help me please i want to continue but im stuck here

  • @ArchAngelAzrael
    @ArchAngelAzrael 4 года назад +1

    Can someone explain the move of "Room Transfer" for the prefab folder, at 12:30 ? And why only "Room Transfer" and not the both "Room Transfer" was transfered to prefab folder ?

    • @08codys90
      @08codys90 3 года назад

      Once you make it a prefab you can reuse it and make many instances of it.
      You can also edit all of the instances of that object at once (what if we want to add a component later? Now instead of however many room transfers you have, you only need to do it once and apply to the rest).
      So while he could have duplicated it, since he turned it into a prefab he can drag it in a new scene without creating it from scratch (not there to duplicate from).

  • @gogla4861
    @gogla4861 3 года назад

    Mister Taft Creates please HELP! When I check the " Is trigger" in the Player collider box, then all borders from both maps disappear. How to fix it?

  • @aldreinalabastro1360
    @aldreinalabastro1360 2 года назад +1

    I'm a bit lost, how did you made a separate room?

  • @chico8315
    @chico8315 2 года назад

    operator += is ambiguous on operands of type vector2 vector3.
    this is my error. how can i solve this. pls help

  • @alexreviews7965
    @alexreviews7965 4 года назад

    When you move the camera, you move it by 25 units in the Y direction, which happens to be 25 tiles. Each tile is 16x16 pixels. Where in Unity is it set that 1 unit is 16px?

  • @ibrahimomar6718
    @ibrahimomar6718 5 лет назад +1

    Assets/roommove.cs(21,9): error CS0106: The modifier 'private' is not valid for this item

    • @NorthGMD
      @NorthGMD 4 года назад

      go to line 21 and change it

  • @asplendidninja4988
    @asplendidninja4988 4 года назад

    I don't think I'm going to use tide to create my tile maps.. will that affect anything in this video using the unity tile map?

  • @NS56sn
    @NS56sn 2 года назад +1

    How did you separate the rooms?

  • @istachu4989
    @istachu4989 3 года назад

    Is it possible to download more assets such as Like trees?
    (Same style)

  • @billyhick5738
    @billyhick5738 4 года назад +2

    When I go to the middle of my next room, the camera jumps to an empty background. How can I fix this?

    • @artsy196
      @artsy196 4 года назад

      Try tweaking your x and y numbers. For y I predicted 21, but it kept on jumping too far. I ended up only putting 6 by the end of it. Hope this helps

    • @thethirdeyesociety
      @thethirdeyesociety 3 года назад +1

      @@artsy196 witch x and y numbers. I'm having the same issue

    • @artsy196
      @artsy196 3 года назад

      @@thethirdeyesociety oh man its been a phat minute since i've touched unity i literally have no idea im sorry

    • @thethirdeyesociety
      @thethirdeyesociety 3 года назад +1

      @@artsy196 Its all good man

  • @h.i.ink.3064
    @h.i.ink.3064 4 года назад +1

    Sooo... if we were to do this part but in the unity tilemap maker, how would we do this? Because i made 2 separate tilemaps but the trigger just isn't working. It seems like nobody has talked about this in the comments so far and I just want to know because I don't feel like switching to tiled just to switch back. :)

    • @aaron58107
      @aaron58107 4 года назад

      Hey there - I am following along with just the unity tilemap maker and was able to get the trigger working so just as a heads up it is possible.
      Things I would check in your game:
      - On the Room Transfer Object, on the Box Collider 2D section - "Is Trigger" should be true
      - On the Player Object, can you confirm the player tag is set to "Player"
      - Make sure you named the method exactly this : OnTriggerEnter2D. Capitalization is important! If you have a lower case e for example - the code will compile but it will not fire.
      - Make sure the box collider 2D is large enough to collide with and its where you expect it to be.
      - If none of the above, try putting: Debug.Log("Transferred to new room"); in the OnTriggerEnter2D and see if that text pops up when you step on it.
      Let me know if you get it working!

    • @h.i.ink.3064
      @h.i.ink.3064 4 года назад

      @@aaron58107 Thank you! I think I didn't change the players tag to Player.

    • @LiamR90
      @LiamR90 4 года назад +1

      Where I'm struggling is with the stuff he said he did off camera. Creating 2 separate tilemaps.
      I've created 2 small maps but now I don't know how to call them 2 different tilemaps. Is there a way to select all of my grids and drag it to a new Tilemap?

    • @aaron58107
      @aaron58107 4 года назад

      @@LiamR90 So my understanding is that when he says "Create two separate tile maps" its repeating the step from the tutorial in Part 4 where he says to right click the hierarchy -> Select 2D Object and then select Tilemap. You should then have two grid items in your scene with a tilemap under each. When I look at his tutorial here thats what I'm seeing.
      He also states that you can continue using a single tilemap and all the code in this video doesn't really care if you have one or two maps - but if you want to match him exactly I'd follow the steps above.
      If both your maps are under a single tilemap and you want it separated - you can always follow the steps above, duplicate your tilemap where you drew 2 small maps and then erase so that each grid/tilemap has one room.
      Its a bit hard to type out but hopefully this makes some sense. Best of luck.

    • @LiamR90
      @LiamR90 4 года назад

      @@aaron58107 Ye, I did go back to when he made the original but it doesn't seem to highlight a specific area. It only gives traits to Ground or Collision.
      I was hoping to be able to highlight all my grids and somehow have that as the tilemap.
      Now if have to just keep it all on a single tilemap and have my camera move X amound of squares into the other area.

  • @robbybloom4885
    @robbybloom4885 5 лет назад +1

    How exactly could we set up different camera bounds for rooms without changing the bounds for the other rooms? Like having the cmaera automatically change it's bounds depending on the room it's in.

    • @MisterTaftCreates
      @MisterTaftCreates  5 лет назад +1

      Hey there. That's the best way to do this. In that case, I'd add a function to the camera to split the world up into grids, 25 by 25 in my example, you can have this work entirely in code. Then when the camera finds the target, have the camera decide which part of the grid it needs to stay in. If the player moves out of that part of the grid, then the camera needs to snap to its new boundaries
      This way would be much more "clean" but much more programming intensive. I decided to go the way I did because I wanted this series to be beginner friendly, but by doing it the other way, you allow for those big fields that you see in ALttP

    • @robbybloom4885
      @robbybloom4885 5 лет назад

      @@MisterTaftCreates ohh alright. I'll try and resize the rooms in that case! Thanks ^^

  • @thegreatapathetic9836
    @thegreatapathetic9836 3 года назад

    Is it necessary to watch this video and/or implement this feature for the continuity of the rest of this series.

  • @nateyfps
    @nateyfps 6 лет назад

    Another great tutorial. Thanks!

  • @brunomoreno3666
    @brunomoreno3666 5 лет назад

    Awesome!!!! I was wondering how this was done, why you make it look so easy?

  • @shinaako3036
    @shinaako3036 4 года назад

    sorry but I can't deal with the problem of rooms of different sizes ... the point is that I can't adjust the camera so that it adapts to them, can you please help nicely please;)?

  • @elijahvalongo9528
    @elijahvalongo9528 4 года назад

    if i put my smoothing to a decimal below 1, my player gets all jerky but walks smoothly when i set the smoothing to 1. but when its at 1, the camera transition is instant, because the smoothing is too high. is there any way i can lower my smoothing down to .1 or .5 without it awkwardly keeping up with my character?

    • @breaker19ist
      @breaker19ist 4 года назад

      make sure the camera is not still parented to the player i had that issue

  • @9jasonsmith03
    @9jasonsmith03 5 лет назад

    Hey so i know this video is nearly a year old but i'm getting an error where it says "Assets\Scripts\RoomMove.cs(25,19): error CS1061: 'Collider2D' does not contain a definition for 'ComparerTag' and no accessible extension method 'ComparerTag' accepting a first argument of type 'Collider2D' could be found" which stops me from having the camera/player change variables showing up in unity, any help would be much appreciated.

    • @MisterTaftCreates
      @MisterTaftCreates  5 лет назад +2

      Hey there. You wrote comparertag instead of comparetag. :)

  • @joaorolao1826
    @joaorolao1826 5 лет назад +1

    Hello! awesome tutorials! congratz!
    I have a problem with my project, the camera only moves if my player is also a trigger... is that normal? what if i Have to define a new minumum and maximum to the camera?
    Thanks once again e keep up the good work!

    • @MisterTaftCreates
      @MisterTaftCreates  5 лет назад

      No that's not normal. I revisit the camera and transitions in a later video using Cinemachine. If you can, jump ahead to the video on observer objects and the video on a cinemachine camera and this should fix most of the issues.

  • @wrxmat
    @wrxmat 5 лет назад

    My rooms are 35 long by 20 made in unity. I'm having trouble with go halfway up into the next room and it puts me back in the 1st room and can't see my character? I've set my 1st room at y being 11 and 2, the top room at - 11 and - 2. Thanks

    • @MisterTaftCreates
      @MisterTaftCreates  5 лет назад

      Hey there. Skip ahead to I think part 36 and part 40, where I add a cinemachine camera. This will fix your issues.

  • @mathboy1212
    @mathboy1212 4 года назад

    My trigger isn't working. I followed the directions but I can walk right through it. Thoughts?

    • @mathboy1212
      @mathboy1212 4 года назад +1

      nevermind. I deleted the empty object and tried again and it works.
      Thank you for the videos.

  • @pickle5074
    @pickle5074 3 года назад

    Howdy! I was wondering what the code would be without any reference to the camera following the player, like Binding Of Isaac.

    • @J0seph_Mother
      @J0seph_Mother 3 года назад +1

      assuming the camera sees the whole room and the rooms are all the same size you would still do the same code since all this code does is move the camera and relock it which should work for something like that

  • @Blazelegend
    @Blazelegend 5 лет назад

    It's an old video but i need your help...i've followed step for step all your passeges but in the code, when i write cam = cameraChange.main.GetComponent(); appear the error CS1061 ‘Vector2’ does not contain a definition for ‘main’ and no accepting a first argument of the ‘Vector2’ could be found (are you missing a using directive or an assembly reference?).....please help me, i don't know how to fix it.

    • @MisterTaftCreates
      @MisterTaftCreates  5 лет назад +2

      Hey there. I re-did the camera system later in the series, and it's safe for you to jump forward to that if you want. It's the two parts called Observer objects and Cinemachine. This will make the room transition work much better.

    • @Blazelegend
      @Blazelegend 5 лет назад

      @@MisterTaftCreates thx you :)

  • @aurian7238
    @aurian7238 5 лет назад +1

    How do you turn a room you make in Unity into an object? I am not using Tiled.

    • @MisterTaftCreates
      @MisterTaftCreates  5 лет назад +1

      I cover this much later. I think it's video 46 - Observer objects.

    • @aurian7238
      @aurian7238 5 лет назад

      @@MisterTaftCreates thank you!!

  • @MrGunsnrosesfan100
    @MrGunsnrosesfan100 6 лет назад

    We have the room transition but it only works one way, when we try to go the other way it simply turns us back as if we were travelling from the first room. How do we fix this?

    • @MisterTaftCreates
      @MisterTaftCreates  6 лет назад

      Hey there. It sounds like your collider for the transition might be so big that it's triggering in both directions. Try to resize it, and let me know.

  • @spikkit
    @spikkit 6 лет назад +1

    So I wrote the RoomMove.cs script exactly like you did, and it compiled correctly and everything, but when I play it, there is an error that says:
    NullReferenceException: Object reference not set to an instance of an object
    RoomMove.Start () (at Assets/Scripts/RoomMove.cs:13)
    The line where the error is occurring says:
    cam = Camera.main.GetComponent();
    And the global variable for cam is set at the top and says:
    private CameraMovement cam;
    I'm not exactly sure why I'm getting this error and I can't seem to find the solution, especially since all of the scripts I've made so far are exactly like you showed. Do you have any idea what might be causing this?

    • @BurgerParty
      @BurgerParty 6 лет назад +2

      try tagiing the main camera with main camera hope it fix yours ty

    • @guindi9414
      @guindi9414 5 лет назад

      @@BurgerParty it solved mine! thanks man

    • @atrixiumalt3880
      @atrixiumalt3880 4 года назад

      @@BurgerParty Thanks you are the best!

  • @skelonz2612
    @skelonz2612 4 года назад

    my room is smaller than the other room that you enter from. I am extremely frusterated at this point. I literally have no idea what to do. So basically, I have my y and x set up so that you can't see past the barriers. But the barriers on the right side. The camera can see over. But on the left they cannot. Also, when I enter the room. It goes in so far that I cannot see the exit anymore. i just have to blindy walk backwards. Please helpp.

    • @zirconkitty3128
      @zirconkitty3128 4 года назад

      // Hello, I was following this tutorial and had the same problem
      // ROOM MOVE SCRIPT
      private void OnTriggerEnter2D(Collider2D other1)
      {
      if (other1.CompareTag("Player"))
      {
      cam.minPosition += cameraChange_MIN;
      cam.maxPosition += cameraChange_MAX;
      other1.transform.position += playerChange;
      }
      }
      // For me, there were small errors i had in my script, such as the min and max position switched around
      // You should also check your other scripts
      // CAMERA MOVEMENT SCRIPT
      void LateUpdate()
      {
      if (transform.position != target.position)
      {
      Vector3 targetPosition = new Vector3(target.position.x, target.position.y, transform.position.z);
      targetPosition.x = Mathf.Clamp(targetPosition.x, minPosition.x, maxPosition.x);
      targetPosition.y = Mathf.Clamp(targetPosition.y, minPosition.y, maxPosition.y);
      transform.position = Vector3.Lerp(transform.position, targetPosition, smoothing);
      }
      }
      // For some reason, i had switched the end maxPosition.y with maxPosition.x
      // I'm sorry, that's all the advice I can give
      // I think as long as your room is not smaller than the camera, it should be fine

  • @skelonz2612
    @skelonz2612 4 года назад

    my room is smaller than the other one. i can't figure ouyt what x to put

  • @arnavdutta8933
    @arnavdutta8933 4 года назад

    what did he mean by two different vectors, one for the min and one for the max?

  • @Ishraq007
    @Ishraq007 4 года назад

    How would we create those two separate rooms like that? Any help on this would be greatly appreciated :P

    • @TheFireDad
      @TheFireDad 4 года назад +1

      You need to make another 2d Tilemap to create separate rooms. 'Grid' essentially becomes Room 1

  • @Gareth84_
    @Gareth84_ 3 года назад

    when i go into the 2nd room it will only allow me to go up so far then it snaps back into the last room but i can walk left and right no problem i can still transition between both rooms just if i walk too high into the 2nd room it pings back

  • @tyrussell3516
    @tyrussell3516 4 года назад

    thank you so much!!!

  • @chrismcvay721
    @chrismcvay721 4 года назад +1

    Help! I never get the OnTriggerEnter2D to happen, I set as trigger in the Room Transfer game object.

    • @lukasvolcik5109
      @lukasvolcik5109 4 года назад

      Hey I had same problem even when I had "IsTrigger" checked on my 2D collider and I had everything right. I am not sure what is the main reason it started working, but mainly instead of just cameraChange I assigned cameraChangeMax and Min to cam.minPosition and maxPosition. This also gives me advantage that my rooms doesn't have to be same size and I just adjust min and max values to match room size. I also installed Unity Tools, because intellisence didn't suggest me OnTriggerEnter method and everything worked just fine without Unity tools until this point.
      If you still have this problem, just write here and I'll help :)

    • @scrolllock4583
      @scrolllock4583 4 года назад

      @@lukasvolcik5109 how did you assigned the cameraChangeMax and min to cam.minPosition and maxPosition ?

    • @lukasvolcik5109
      @lukasvolcik5109 4 года назад

      @@scrolllock4583 Instead of one cameraChange on the top you declare two like: public Vector2 cameraChangeMax; ... and also same for "cameraChangeMin".
      Then in onTrigger method, you just assign it like:
      cam.minPosition += cameraChangeMin;

      cam.maxPosition += cameraChangeMax;
      ... Funny thing is that I made Debug.Log before if statement and even when it got working, my Debug.Log still don't notice that it's working :D :D

    • @lukasvolcik5109
      @lukasvolcik5109 4 года назад

      @@scrolllock4583 I kinda messed up with everything like removing collider2D and making a new one, changing size of players collider, because problem really can't be in that script. Maybe just try bigger minimal value in editor. You can send me pictures or videos of what is happening to you on FB with same name as this account and surely I can help.

    • @scrolllock4583
      @scrolllock4583 4 года назад

      @@lukasvolcik5109 i think i added you ?

  • @vicvaporus
    @vicvaporus 4 года назад +2

    Hi! This tutorial is very nice, it has been extremely helpful to do a step forward and start with Unity at last. Thank you very much!
    I'm having some issues with warping the camera during the transition; when I play the game, this message appears:
    NullReferenceException: Object reference not set to an instance of an object
    RoomMove.OnTriggerEnter2D (UnityEngine.Collider2D other)
    If I've understood correctly, the problem is in the following line :
    "cam = Camera.main.GetComponent();"
    Can someone help me with this? Thanks!

    • @MisterTaftCreates
      @MisterTaftCreates  4 года назад +1

      Hey there. That error comes when the script is trying to access an object, but the object was never referenced completely, so the reference is null or empty. Check to make sure you've completed connecting the objects outside of the script in the inspector.

    • @vicvaporus
      @vicvaporus 4 года назад

      @@MisterTaftCreates Thank you very much! :D There was indeed a problem in the minPosition and the maxPosition in the inspector.

    • @tez1000
      @tez1000 4 года назад +1

      Hi, I've run into the same problem and I can't really figure it out. Could someone please help me? It just still showing the same message and nothing really is fixing it. I've been trying writting code once again, but it didn't help.

    • @tez1000
      @tez1000 4 года назад +1

      Nevermind I fixed it. If someone also have this problem, just tag your camera "MainCamera". It's a deafult tag in unity and it should help.
      Btw great videos dude :D

    • @demiedzik
      @demiedzik 4 года назад

      @@tez1000 aaaaaaaaaaaaaah THANK YOU! :)

  • @ganondorfchampin
    @ganondorfchampin 4 года назад

    I remember back in the last camera video you said that in this video you'd set min and max programmatically rather than empirically, but I'm not seeing any of that. So how do you do that?

  • @Plazmin
    @Plazmin 4 года назад

    Do you think that you can put the source code on a GitHub?

  • @darkenedninja5998
    @darkenedninja5998 5 лет назад

    I am new to C# and unity in general, I was wondering what to do if the transition is from one room size to a bigger size, how would I set some the cameras bound min/max x and y. Also just wanted to say your tutorials are amazing to learn how unity works, I know this comment is after the video has been out, but was hoping I could still get help for this issue (sorry if it's hard to read/understand)

    • @MisterTaftCreates
      @MisterTaftCreates  5 лет назад +1

      Hey there. Jump forward to part 48 for a quick minute and institute Cinemachine. It will work much more nicely for rooms of different sizes. Then you can jump back to where you are now.

    • @darkenedninja5998
      @darkenedninja5998 5 лет назад

      @@MisterTaftCreates Thank you! your tutorials have been a great help in learning. Have a good day

  • @altonmartin7355
    @altonmartin7355 6 лет назад

    Hello, how do change the bounds of your room if one room is bigger horizontally and vertically?

    • @MisterTaftCreates
      @MisterTaftCreates  6 лет назад

      Hey there. You would just set the min and max x and y accordingly. For example, if the new room is 40 tiles by 25 tiles, then adjust min and max x by the change on those axes, and the min and max y by 25. Let me know if that doesn't help.

    • @altonmartin7355
      @altonmartin7355 6 лет назад

      @@MisterTaftCreates This works for the bigger room but now the camera is not bounded for the previous smaller room enabling the player to see into the next room before they hit the transition.

  • @Daevidivead
    @Daevidivead 4 года назад

    You are amazing