How to make Asteroids in Unity (Complete Tutorial) 🚀🌑

Sdílet
Vložit
  • čas přidán 23. 07. 2024
  • Learn to make the classic 2D arcade game Asteroids in Unity. Asteroids is a space-themed multidirectional shooter arcade game designed by Lyle Rains, Ed Logg, and Dominic Walsh and released in November 1979 by Atari, Inc. The player controls a single spaceship in an asteroid field which is periodically traversed by flying saucers. The object of the game is to shoot and destroy the asteroids and saucers, while not colliding with either, or being hit by the saucers' counter-fire. The game becomes harder as the number of asteroids increases.
    0:00​ - Introduction
    1:10 - Project Creation
    1:57 - Scene Setup
    7:42 - Player Movement
    19:22 - Shooting
    32:25 - Asteroid Prefab
    42:06 - Spawning Asteroids
    1:04:22 - Destroying Asteroids
    1:16:09 - Dying & Respawning
    1:34:19 - Explosion Particle Effect
    1:44:31 - Scoring
    1:49:17 - Game Over
    1:51:33 - Outro
    🖥️ Source code and assets: github.com/zigurous/unity-ast...
    👍 Subscribe for more Unity tutorials: czcams.com/users/zigurous?sub...
    💬 Join our Discord community: / discord
    👑 Become a Patreon supporter: / zigurous
    ❤️ Support my work: www.paypal.com/donate?hosted_...
    ⭐ Download my Unity assets: zigurous.com/assets
    ········································­­·······································­·­····
    ► Learn more about my work: zigurous.com
    ► Follow for news and updates: / zigurous
    #unity #unitytutorial #gamedev #unity3d #unity2d #gamedevelopment #indiegame #indiedev #madewithunity

Komentáře • 146

  • @Zigurous
    @Zigurous  Před 2 lety +10

    Visit the GitHub page for the most up to date source code: github.com/zigurous/unity-asteroids-tutorial
    View the FAQ for answers to common questions: github.com/zigurous/unity-asteroids-tutorial/wiki

    • @dhunsworth
      @dhunsworth Před rokem +2

      Only about halfway through, but awesome tut! You nailed dropping in just enough explanation here and there to help connect the dots...and the wiki, super nice touch! First time I've seen that for this type of channel and it makes so much sense!

  • @janhrubec7643
    @janhrubec7643 Před 3 lety +55

    Slowly making my way through these tutorials, really love them. You're gonna be big someday

  • @JakeSimmer
    @JakeSimmer Před rokem +6

    Hey brother, I'm an oldschool guy that have played the original Astroids game, sadly I did not have the money or drive to get that thing for myself. I did know that this was special tho. Now, at 55, I'm learning to program one of the originals, that's very cool. Thanks for this tut, and the others of cause. Cheers from Holland, Jake. ;-)

  • @marklondon9004
    @marklondon9004 Před rokem +4

    One of the best tutorials I have seen on CZcams. Perfect speed and excellent mix of supplying assets and showing development method.

  • @unwindshow
    @unwindshow Před rokem +2

    Just got to the end of this! First game I've ever made :) Super clear to follow, learned a ton. Thank you!

  • @orick08
    @orick08 Před 2 lety +5

    discover your channel was one of the best things can happen to my career, I'm learning a lot, thank you

  • @mattw6399
    @mattw6399 Před 2 lety +1

    I like that he does and says things slowly, I've watched other tutorials and sometimes the people go way to fast and it's most likely because there passionate about what they do, but it can be hard to follow for people who don't know where everything is quite yet. I think the background music is good too, it's calming and nicer than just listening to someone talking.

  • @joliveres
    @joliveres Před rokem +3

    I really enjoy your teaching style, speed, and clarity. This is the second tutorial I've done of yours to get back in the flow after not coding for a while and both have been great.

  • @richardolsen1113
    @richardolsen1113 Před 2 lety +3

    This is one of the best tutorials I've seen for Unity and C#... seriously absolutely amazing. I'm learning so much! Thanks a million and keep it up!

  • @Huedini74
    @Huedini74 Před 27 dny

    I started playing around with Game Maker, then UE5, then Godot, and now Unity. Programming has been the biggest hurdle for me, so I am also watching other C# tutorials. This has been a very well-paced tutorial and explained well. Thank you!

  • @tayfunyirdem
    @tayfunyirdem Před 2 lety +1

    AWESOME! Best game development tutorial series i've ever seen.

  • @TomFirth
    @TomFirth Před měsícem

    Possibly one of the best tutorials i've found on CZcams.
    `score += -(int)Mathf.Round((asteroid.maxSize - asteroid.size) * 100);` score based on size idea.

  • @jweare333
    @jweare333 Před 2 lety +29

    Your videos are really great! You don't say perplexing things like "This seems really complicated, but it isn't" (and then proceed to not explain it). You are covering not only the how to put the pieces together, but the why each part works the way it does and that is good teaching. Thanks! If you plan to stick to arcade style games, May I suggest Defender, Joust, and Galaga. If you plan to try something outside of the arcade genre then I'd love to see something turn-based. Maybe a simple tb rpg or strategy game. I can't wait to see more.

  • @luluckas1980
    @luluckas1980 Před 2 lety +1

    Thank you ! i'm starting Unity and coding, i've done Snake and now Asteroids with your tutorial and i'm starting to understand what i'm doing! Keep it up!

  • @Boredest1
    @Boredest1 Před 2 lety

    Thanks for the tutorial. I really enjoyed working through it and I appreciate the time you took to explain things. Looking forward to seeing more!

  • @hemanths6066
    @hemanths6066 Před rokem

    Thanks a lot for the detailed tutorial. I finally learnt many concepts with this session and parallelly finished making the game (with little tweaks). Once again. Thanks.!

  • @ronsage452
    @ronsage452 Před 2 lety +1

    Great tutorials. Thank you for all the time you spend making these with us.

  • @timmc1308
    @timmc1308 Před rokem

    This is an outstanding tutorial! That for posting it. Going to try and work on the UI. I will look at your other tutorials as well.

  • @Josh-zt9dj
    @Josh-zt9dj Před rokem +4

    Great tutorial love your explanations I also like how efficient your programming is and how you tailor it to your viewers knowledge perfect for beginners!

  • @TheSteveTheDragon
    @TheSteveTheDragon Před 3 lety +3

    Really nice tutorial! Thanks for making these!

  • @itsmorlok
    @itsmorlok Před 2 lety +8

    Wow Adam, this is the best unity tutorial i have ever watched, because i just love that its a full game, step by step, looks solid and you explained everything really clearly. Im a newbie, i understood most of the concepts and this really helped. Thanks a lot and keep it up!

  • @spacegirl2525
    @spacegirl2525 Před 2 lety +1

    Thanks for making this tutorial. It has been a great help in my school assignment.

  • @reflexindiegame
    @reflexindiegame Před 2 lety

    Thank you so much. I really happy for learn these tutorials.

  • @Francisco-Gutierrez
    @Francisco-Gutierrez Před rokem

    Thanks Adam for sharing your knowledge!

  • @user-hd2ft2br9c
    @user-hd2ft2br9c Před 3 měsíci

    u r best. easy, brief, to the point, well explained. Thanx bro.

  • @andymellado4285
    @andymellado4285 Před 7 měsíci

    very great video, love your content

  • @nine8336
    @nine8336 Před 2 lety +2

    great video i love this channel, it helps me a lot
    thanks :D

  • @Rafael-hk2st
    @Rafael-hk2st Před 2 lety +1

    Thank you for this tutorial, helped me out a lot! Liked and subscribed ;)

  • @jameslavery2958
    @jameslavery2958 Před rokem

    I'm late to the party, but I really enjoyed this tutorial.
    Excellent. Thank you.

  • @maximumreality
    @maximumreality Před rokem

    Thank you very much for the lessons!

  • @Orl_a_n_Do
    @Orl_a_n_Do Před rokem

    Thank you very much ! Its very cool tutorials!

  • @friendlyhello
    @friendlyhello Před 3 lety +11

    Really enjoying your tutorials! Thank you for making them. Would you consider doing a tutorial for a classic retro FPS dungeon crawler like Wizardry or Ultima? Frogger would be neat, too. Thanks again! I look forward to more!

    • @Zigurous
      @Zigurous  Před 3 lety +2

      I'll definitely consider those suggestions, thanks for watching!

  • @ameri111
    @ameri111 Před 2 lety +1

    These tutorials are absolutely the best! thank you for making them! if you're taking suggestions then maybe can you please do an idle clicker game (like cookie clicker). And if you're thinking of something more advanced then a tower defense game, endless runner, or a gacha style turn-based rpg?

  • @kwipxd
    @kwipxd Před 2 lety +6

    Really great tutorial us always! one thing i would've liked is for you to have included the UI in the video since it can be a lot harder for people to understand things just by looking at code, although i get it would've added a lot more steps to the tutorial

  • @johnrasc6544
    @johnrasc6544 Před 3 lety +7

    Hope you make more soon!!

  • @random_precision_software

    Just came across your channel, hope you do a lot more!

  • @dermotbyrnemusic
    @dermotbyrnemusic Před 3 lety +1

    excellent tutorial!

  • @believe113
    @believe113 Před 8 měsíci

    Thank You So Much Sir. You Helped me alot. Thank you for such a wonderful teaching and explanation 🙏.Best Tutorial for Sure.

  • @gamegasm5929
    @gamegasm5929 Před 3 lety +1

    Thank you Adam. Sincerely

  • @gokhankaptan8890
    @gokhankaptan8890 Před 2 lety +1

    bro you are pretty good at this

  • @biged606
    @biged606 Před rokem

    👍🏻👍🏻👍🏻u r the best! Just keep going! 👌

  • @yuchengli6079
    @yuchengli6079 Před 2 lety +1

    thanks for helping me to understand the unity engine

  • @brownguyart
    @brownguyart Před rokem

    Completed this tutorial :)

  • @johnrasc6544
    @johnrasc6544 Před 3 lety +3

    NICEEEEE

  • @BlenderJourney-t7t
    @BlenderJourney-t7t Před rokem

    Good job! Thanks!

  • @yusufkoraycan4607
    @yusufkoraycan4607 Před 2 lety

    Thanks man!

  • @speeddragon48
    @speeddragon48 Před rokem

    Cool!

  • @imadsaddik
    @imadsaddik Před rokem

    Thank you

  • @staznamikaze2701
    @staznamikaze2701 Před 2 lety +1

    thanks my man

  • @mattsithknight1530
    @mattsithknight1530 Před 2 lety +1

    Amazing tutorial, learned loads, thankyou. Any chance of a follow up video showing how to do the UI adding the score and game over screen etc?

  • @TransGuyShane
    @TransGuyShane Před 2 lety +1

    and done

  • @asifameerr
    @asifameerr Před rokem

    just completed!

  • @LuthfiAlv
    @LuthfiAlv Před 2 lety

    THANKYOU FOR YOUR TUTORIAL.. REALLY HELO MYSELF, :D

  • @Ozblivion
    @Ozblivion Před 2 lety +1

    if your player invulnerability wont work check to make sure the layer names are the same, also check for a space at the end.

  • @m4ster311
    @m4ster311 Před 2 lety

    Its a very good tutorial! Can you do a tutorial how to do a 3d game? I know 3d is much harder than 2d but its intresting, you dont need to do a very hard game thats took many of hours to prepare

  • @Pr3s3nt3r123
    @Pr3s3nt3r123 Před 2 lety +2

    next brackeys

  • @mridulagrawal3435
    @mridulagrawal3435 Před 2 lety +1

    Hi, Thanks for the tutorial. I am stuck at a point though, my particle system is producing particles with random initial alpha values. some are opaque initially but most of the particles have low initial alpha value, and it seems to be random. how can I fix that can anyone help please?

    • @Zigurous
      @Zigurous  Před 2 lety +1

      In the particle system component, there is a "Start Color" property that you can set. One of the options is to make it random. Perhaps yours got set to this.
      There is also a "Color Over Lifetime" property which we use in the video. It's possible to change this to be random as well. Double check those.

  • @Labyrnthdom
    @Labyrnthdom Před rokem

    Hmmm in the video your using a different version then what you have listed for the assets used.
    Unity 2019.4 LTS
    So will this still work to follow along without having some sort of errors?

  • @MattMajcan
    @MattMajcan Před rokem

    hey, really great tutorial. i know i probably wont get an answer, but what if i wanted to add a max speed to the ship so that it cant go zooming off into infinity? i implemented it pretty easily but then the problem is the ship wont thrust when its pointed in the opposite direction of travel but it definitely should. ive tried all kinds of math and equations and cant figure it out.

    • @justinanderson267
      @justinanderson267 Před 11 měsíci

      AddForce has no top end. You need an entirely different move method.

  • @kurt2009
    @kurt2009 Před 2 lety

    how would i make it so that the S key or down arrow key makes the player move backward?

  • @uniKorn8
    @uniKorn8 Před 2 lety +2

    Another Easy to Follow Tutorial, learning a lot about coding. The particle system icon was on game screen all the time when playing, right after animation that icon appeared where the animation was played, that was annoying. I'm using version 2020.3.22f1, maybe it's a bug there or maybe i've clicked somewhere accidentally, where i was not supposed to click. changed Explosions position out of camera (x -11) and ring buffer mode from disabled to pause until replayed. Now the annoying icon stays away.

    • @Zigurous
      @Zigurous  Před 2 lety +2

      I think those icons you are referring to are called Gizmos. There's a toggle in the editor to turn them on/off.

    • @uniKorn8
      @uniKorn8 Před 2 lety

      @@Zigurous yes, that's it, I had gizmos on.

  • @christoferi9636
    @christoferi9636 Před měsícem

    i have Lunix and i code with VS Code, what extensions could I use for Unity, because is too hard for me to write in a good way

  • @SRIRAMCHANDR
    @SRIRAMCHANDR Před 5 měsíci

    👍

  • @lokhad3086
    @lokhad3086 Před rokem +1

    55:43 For setTrajectory function we need to normalize -spawnDirection

  • @caeleng5553
    @caeleng5553 Před rokem

    I seem to have a problem where I get an IndexOutOfRangeException error for when selecting random sprites. It tells me that the index was outside the bounds of the array but I'm not sure why as I have triple checked that the code is the same as yours. I have also checked that the sprites have been selected in the inspector. The error also only appears when the player shoots. Do you have any ideas what might be wrong?
    Cheers for the tutorials they are very helpful and easy to follow along

    • @caeleng5553
      @caeleng5553 Před rokem

      Problem solved -my bad. Turned out i accidentally added the wrong script to the wrong object

  • @dhimgirish7161
    @dhimgirish7161 Před 3 měsíci

    For Layer Collision in Physics 2D, You will find 2 tabs on top, General Settings and Layer Collsion Matix. Click on the layer Collison Matrix there you will find the Layer Collision for Physcis 2D.

  • @jtgotsjets
    @jtgotsjets Před 2 lety

    Soooo...where do I go to find out the *right* way to create a global reference to a GameManager method?

  • @revalor8034
    @revalor8034 Před 8 měsíci

    hey bro im stuck with Layer Collision Matrix... im using vers 2022.03.0f1. I found the Layer Collision only in "Physics" not "Physics2D". i tried to change Layer Col on Physics since idont found it on 2D and its still not fix. can anyone help me please reply this comments ASAP

  • @shonelifting
    @shonelifting Před 3 lety +1

    When will next tutorial be uploaded love arcade games 😂❤️ cant wait for pac-man

    • @Zigurous
      @Zigurous  Před 3 lety +5

      I'll be make a new video this week and it should be ready by upcoming Monday.

  • @hippopotamus86
    @hippopotamus86 Před 2 lety

    Any advantage to using Vector3 over a Vector2 on a 2d game?

    • @Zigurous
      @Zigurous  Před 2 lety +1

      No not necessarily. I tend to use Vector3 out of habit because I work in 3D spaces more, and because the underlying types are still Vector3. That said, if you can use a Vector2 then I would use that as it can simplify your code and improve readability in 2D games.

  • @theredhacker6606
    @theredhacker6606 Před rokem

    How to increase spawn rate and player speed overtime?

  • @Meithighs
    @Meithighs Před 2 lety

    bummer there isnt a part with screen wrapping the ship and asteroids if they hit the boundaries, not sure why you added those assets in, im not entirely sure how to go about directing the asteroids to be allowed in but still make their way around the zones.

  • @urahs
    @urahs Před 2 lety

    Cant open this project in unity hub. It shows a blue screen only

  • @perhael6400
    @perhael6400 Před rokem

    I followed the code but it is giving me compiler error messages. I tried to copy and paste some of the code and I am still getting messages. Does anyone know why that might be?

  • @timotheekamdem829
    @timotheekamdem829 Před rokem

    can we do it for android phones ?

  • @chrisignacio6898
    @chrisignacio6898 Před 2 lety

    at 26:13..I get the error msg: 'Bullet' does not contain a definition for 'Project' and no accessible extension method 'Project' accepting a first argument of type 'Bullet' could be found (are you missing a using directive or an assembly reference?) can you help?

    • @Zigurous
      @Zigurous  Před 2 lety

      I believe your Project function inside of the Bullet script is not set to be public therefore you cannot access it from outside its class. Try changing it from private to public.

    • @Vekten
      @Vekten Před 2 lety

      At 25:15 you have to make sure the word on line 14 in Bullet.cs is " public void Project(Vector2 direction)" and not anything else.
      I had this problem where it changed to Projector instead of Project.
      Just an error on our part to not type the code EXACTLY as the engine wants. These things are really tricky and will point the direction of the problem elsewhere instead of where it should have been.
      TL;DR. Line 14 in Bullet.cs needs to be exact.

  • @MadMax-mw3og
    @MadMax-mw3og Před rokem

    Really liking this tutorial, However, Early on I get NullReferenceException: Object reference not set to an instance of an object. I have added the bullet prefab references to the player like instructed, so I dont really know what I am doing wrong

  • @gautamgarg7377
    @gautamgarg7377 Před 2 lety +1

    i have done all things the same but at 1:00:30 the asteroids still don't pass through the boundries and my spaceship automatically goes out of the camera view. Please help.

    • @Zigurous
      @Zigurous  Před 2 lety

      If the asteroids are not passing through the boundaries then that means they are colliding with them. We want to turn off collision between the asteroids and boundaries. This is done by setting these game objects / prefabs on different layers, then changing the 2d collision layer matrix in your project settings. Keep in mind when setting the collision matrix, there is separate settings for 3D vs 2D. Be sure to select the "Physics 2D" tab.
      If the spaceship is able to fly out of the camera view, then it's a similar problem. One or more of your game objects / prefabs must not have the correct layer set or the collision matrix hasn't been changed.

  • @NamikazeNaruto4321
    @NamikazeNaruto4321 Před rokem

    How did you get the not equal sign?

  • @InvisaPotion
    @InvisaPotion Před 2 lety

    When I destroy one astroid I get the message - The object of type 'Asteroid' has been destroyed but you are still trying to access it. pls help

  • @presidentvch9709
    @presidentvch9709 Před 2 lety

    can you make it for pc please? because I really like it and want to play it when I'm on the computer

    • @Zigurous
      @Zigurous  Před 2 lety

      A build of the game can be downloaded from here: github.com/zigurous/unity-asteroids-tutorial/releases/tag/v1.0.0. Look for the Asteroids.zip link. It's built for Windows.

  • @PrecognitionInc
    @PrecognitionInc Před 2 lety

    How do ytou write the does not equal to symbol?

  • @brownguyart
    @brownguyart Před rokem

    Can you please make a 3d tutorial?

  • @Ozblivion
    @Ozblivion Před 2 lety

    ADD SCORE UI, OK so i figured a way to add a score counter that you can see in game, first you need to add a text (in the UI bar in add) and then you need to add a "public Text ScoreText" in the method area and add a void update at the bottom of the GameManager Script, ad this "ScoreText.text = score.ToString();" also at the very top underneath "Using.UnityEngine" add "using.UnityEngine.UI; if this isn't clear then ask in reply and ill try and clarify it.

  • @krishantpoudel3500
    @krishantpoudel3500 Před měsícem

    how to add settings to this game

  • @ideletemyelf1585
    @ideletemyelf1585 Před 3 lety +6

    love the tutorial but PLEASE... Take a drink next time homey, take... a... drink... Thank you lol...

  • @tahanasir147
    @tahanasir147 Před 6 měsíci

    Can you plzz help me . I did everything same but my asteroids are spawning out of the box. Please kindly tell me the solution

  • @blck21
    @blck21 Před 2 lety

    16:38 Can u pls explain what keys u used in keyboard to run and get it in unity?

    • @Zigurous
      @Zigurous  Před 2 lety +1

      I think you are referring to the not equal sign, which is typed as !=
      I have turned off font ligatures for my future videos to prevent confusion on stuff like this.

    • @blck21
      @blck21 Před 2 lety

      @@Zigurous No I mean, u typed the code in visual studio and got it running in unity, how did u did that?
      For me it's coming compiler error

    • @Zigurous
      @Zigurous  Před 2 lety

      @@blck21 You can use any editor you want to write the code. You can select your editor via the menu Edit > Preferences > External Tools. If you have a compiler error then you have mistyped something. If you post the error, I can try to provide more insight.

    • @NamikazeNaruto4321
      @NamikazeNaruto4321 Před rokem

      @@Zigurous what did you type to get not equal sign?

    • @justinanderson267
      @justinanderson267 Před 11 měsíci

      ! Means not.
      != Mean not equal
      !isThrusting means the opposite of isThrusting. If isThrusting is true, !isThrusting is false.

  • @newleaf1234
    @newleaf1234 Před 2 lety

    Whenever I type in >= , unity sends out an error message "Invalid expression term '>=' " Can someone please help? Thank you!

    • @Zigurous
      @Zigurous  Před 2 lety

      What does the rest of the line of code look like? You might be missing a parenthesis or something else that is causing the problem.

    • @newleaf1234
      @newleaf1234 Před 2 lety +1

      @@Zigurous Thank you so much for the reply ! But I figured it out after sometime ! I was missing a parenthesis and i changed the capitalization in setTrajectory ! Thanks for the tutorial mate! It really helps a lot!

  • @brutalgamer1507
    @brutalgamer1507 Před rokem

    Is this for Android?

  • @josephmoussa564
    @josephmoussa564 Před rokem

    If i wanted to increase the speed of the asteroids every time it reaches a score of 1000 how would i go about it?

  • @JustGer
    @JustGer Před 2 lety

    How can i add a joystick?:(

    • @justinanderson267
      @justinanderson267 Před 11 měsíci

      Change
      isThrusting = Input.GetKey(KeyCode.W);
      To
      isThrusting = Input.GetAxis("Vertical");

  • @n7pankake236
    @n7pankake236 Před 6 měsíci

    idk why but the particle system doesn't want to work for me.

  • @GurdevSeepersaud
    @GurdevSeepersaud Před 2 lety

    21:07 "Doodoo"

  • @rosey3747
    @rosey3747 Před 3 lety +1

    First

  • @diyorkhaitov583
    @diyorkhaitov583 Před rokem

    my asteroid do not dissapear afther shooting

  • @shonelifting
    @shonelifting Před 3 lety

    No new tutorials yet ☹️😊

    • @Zigurous
      @Zigurous  Před 3 lety +1

      New tutorial czcams.com/video/qWDQgmdUzWI/video.html, sorry for the delay!

  • @jovelove2115
    @jovelove2115 Před 11 měsíci

    The original asteroids had no drag lol

  • @BruhLordEternal
    @BruhLordEternal Před rokem

    I got kinda upset looking at your source code because its very different then what you showed in the video, and I just wonder why you didn't do it like you have it in the first place because I pretty much have to rewrite everything to get player movement to work. Why the tutorial isn't consistent with the actual code bewilders me.

  • @justinanderson267
    @justinanderson267 Před 11 měsíci

    Here is my player controller
    Note: for those of you looking for a "reverse" this works
    Rigidbody2D rb;
    Vector2 InputAxis;
    float rotateSpeed = 2.0f;
    void Awake() {
    rb = GetComponent();
    }
    void Update() => PlayerInputs();
    void FixedUpdate() => PlayerMovement();
    void PlayerInputs() {
    float xAX = Input.GetAxis("Horizontal");
    float yAX = Input.GetAxis("Vertical");
    InputAxis = new Vector2(xAX, yAX);
    }
    void PlayerMovement() {
    Vector2 moveDirection = rb.transform.up;
    moveDirection.Normalize();
    if(InputAxis.y > 0)
    rb.AddForce(moveDirection);
    if(InputAxis.y < 0)
    rb.AddForce(-moveDirection);
    rb.transform.Rotate(0, 0, -InputAxis.x * rotateSpeed);
    }

    • @justinanderson267
      @justinanderson267 Před 11 měsíci +1

      Also, if youre looking to "warp" your ship to the opposite side of the screen
      Make two more scripts. "SideBoundary" and "VerticalBoundary"
      Make sure the boundary game objects have their BoxCollider2D "Is Trigger" box is checked!!!
      Add this to the SideBoundary script, and attach the SideBoundary script to the East and West side Boundaries.
      void OnTriggerEnter2D(Collider2D target)
      {
      target.transform.position = new Vector2(target.transform.position.x * -1, target.transform.position.y);
      }
      Same for the North and South boundaries. Put the vertical script on them, and add this in the script
      void OnTriggerEnter2D(Collider2D target)
      {
      target.transform.position = new Vector2(target.transform.position.x, target.transform.position.y * -1);
      }
      And there ya go! Now anything that hits that box collider will warp!
      If you want to specify which object warps, make a new script called "Warpable"
      You dont need to actually edit this script. Just make it, and attach it to whatever object you want to be able to warp.
      Add this line to the two Boundary scripts
      void OnTriggerEnter2D(Collider2D target)
      {
      if(target.GetComponent() != null)