CHANGING GRAVITY PLAYER CONTROLLER - EASY UNITY TUTORIAL

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

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

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

    This was EXACTLY what I was looking for, it's so, SOOOOO much easier than I thought! Thanks for making this tutorial, you're amazing!

  • @blueiceshard6238
    @blueiceshard6238 6 ปีที่แล้ว +21

    Fun Fact: I created a game a few years ago with a gravity change mechanic and I am currently creating a more polished version (this time with Unity instead of LibGDX) to release later this year.
    So this tutorial really got me covered!

  • @AlexanderZotov
    @AlexanderZotov 6 ปีที่แล้ว +42

    Great as usual)

    • @monohero231
      @monohero231 5 ปีที่แล้ว +2

      Alexander Zotov love your channel

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

    this is so clear and quick, its like eating cake with learning, little bites can handle, you cant eat a full cake in one shot, since its to much to handle, same with the mind, little bite size videos help keep the knowlege in tack, and not flying else ware, brilliant job man

    • @xdiatia4197
      @xdiatia4197 4 ปีที่แล้ว

      Yeah, I wish SCHOOLS did bite size teaching, here in egypt most of the things we learn are things we won't even use in any job we take, and Homework is the worst, my arabic primary teacher's homework was TEN FREAKING SHEETS WE MUST COPY and class work was SIX SHEETS AND FIVE BOARDS IN ONE HOUR and if we did'nt finish and she is the las in day she would make us all STAY IN CLASS while everyone is going home, glad i'm going to middle school because the teachers are a little loose unlike PRIMARY, and that was only arabic.

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

    Hahah man this is weird but I love your voice. I must have watched a tutorial of yours a week or so ago, and all week, your voice has been stuck in my head , was trying to find your channel again and just found it. Great engaging videos man! Love it.

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

    Ooooo interesting topic! Keep up the great work, you inspire me so much! :D

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

    Hey noa, I love your art style. Really nice idea of using artwork while explaining tutorial. Especially those arts look cute. I always love your channel. All the best with your channel noa.

  • @SoyFerxdd
    @SoyFerxdd 6 ปีที่แล้ว +10

    I have a problem, what or where is facingRight?

  • @what_the_feek5568
    @what_the_feek5568 6 ปีที่แล้ว +2

    hey you ..... you are amazing. You deserve a huge more subs than this and sure you will achieve it one day. Your contents are amazing. The way you explain, those cool small small anims and edits... you are simply great buddy. All the best... After brackeys you are my favorite game developer. I just want few more 3d tuts thats it.

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

    This was super helpful for the game I'm making!

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

      I NEED HELP PLEASE, it don't work for me can you help me ??

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

      @@ameliedallest1848 I've only been learning Unity for a week, but I can try!

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

      @@GuitarsRgood7 i love you thanks

  • @jeppy4021
    @jeppy4021 5 ปีที่แล้ว +2

    I was searching for a tutorial for my megaman's gravity man type level....thanks for the video

  • @sjcasey77
    @sjcasey77 5 ปีที่แล้ว

    pretty good solution to my spider platformer. another great tutorial, thanks

  • @FPVLIFE
    @FPVLIFE 6 ปีที่แล้ว +2

    Great tutes 👌😍

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

    THANK YOU SO MUCH THIS HELPED ALOT

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

    thank you. this may help me with my underwater levels...

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

    Everything worked... until you started using the player controller in the script.
    I typed
    private Player player; and the script didn't recognise the word Player...
    If anyone could help it would mean a lot.

    • @Ace-tu2mu
      @Ace-tu2mu 5 ปีที่แล้ว

      Player is the script he wrote for the player movement, you should watch the platformer controller video first.

    • @CringeMaster64
      @CringeMaster64 5 ปีที่แล้ว

      @@Ace-tu2mu it's ok i already fixed it. Still thanks for commenting...

    • @CringeMaster64
      @CringeMaster64 4 ปีที่แล้ว

      @@crazycatarz636 Yea, did the same and it works

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

    thanks!

  • @ronnieshmuel5193
    @ronnieshmuel5193 6 ปีที่แล้ว +2

    A Challenge: I think you should also give a solution for gravity switch to the left or to the right. if you want more than that -> gravity switch to any given plain (in any angle) when clicked :)

    • @Blackthornprod
      @Blackthornprod  6 ปีที่แล้ว

      Switching gravity to the left or right is easy peasy :) (showed how to do it in the tutorial), as for gravity in any angle, that's a little more tricky, nice challenge :) !

    • @saurabhsharma-qw1io
      @saurabhsharma-qw1io 3 ปีที่แล้ว +1

      @@Blackthornprod Doing it in any angle is as easy. I have added 2 empty objects on top and bottom of the player and when it rotates I take the normalized difference in their position and use it as gravity scale. Only issue I am getting is when I do change the gravity angle it happens to all of the rigidbodies not the one script is attached to. Any solution please.

  • @jamesnation6676
    @jamesnation6676 6 ปีที่แล้ว

    I want to make video games and your videos help so much!

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

    FUNTASTIC! :D
    What is the song name at 1:50? Sounds familiar

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

    Thanks for the tutorial;)

  • @NuNaKri
    @NuNaKri 4 ปีที่แล้ว

    Thank you, very helpful vid :D

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

    pls somebody know the same thing but for 3d? Pls help :(

  • @72вайті
    @72вайті 5 ปีที่แล้ว

    You is top one youtuber.

  • @supersaiyan9616
    @supersaiyan9616 6 ปีที่แล้ว +5

    Please make tutorials on 3d and 2d game art.are you draw cartoons with mouse or touchscreen?.

    • @priyajvora1824
      @priyajvora1824 6 ปีที่แล้ว +2

      My Dreams. 20M views he said they'll be coming out soon, can't wait

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

    When i press space and press space again while in midair i go back to the ceiling...
    I do not want to not press the space bar in midair and goes back up. What code will i put here?

  • @angelosathanasopoulos2609
    @angelosathanasopoulos2609 4 ปีที่แล้ว +2

    im a begginer and i wanted to make a game in which the player would teleport up and down when you clicked space and i tried that method but with super high gravity so it is like teleporting.But it seems it is to not the best method...Can anyone help me?

    • @mrtz187
      @mrtz187 4 ปีที่แล้ว

      you could just add a value to your rigidbody's position to teleport

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

    How can I make it so that the player can only switch gravity from top to bottom while they are on the ground? I don't want my player being able to swap while in mid air.

  • @PhilDeveloper
    @PhilDeveloper 4 ปีที่แล้ว

    Cool and helpful

  • @donslyhiggins2620
    @donslyhiggins2620 6 ปีที่แล้ว

    exactly. what. i. needed. and its blackthornprod too!

  • @Seiku
    @Seiku 6 ปีที่แล้ว +2

    Awesome.

  • @christianaguilar6185
    @christianaguilar6185 4 ปีที่แล้ว

    I got an asap question. Im doing a game about this mechanic and i have a problem just because my assets got to have the pivot on bottom center and it transport to the other side of the ground is standing, everytime i try to switch gravity. I just need help about this :(

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

    Can some one point me to right direction. My character is unable to jump when being on inverted gravity ( and rotated 180). All environmental objects have layer Ground set to them so that is not the case. I came to this tutorial from your double jump tutorial so I'm using those scripts as Player controller.

    • @Diedamni69
      @Diedamni69 5 ปีที่แล้ว +2

      Just realized that I had to add line:
      player.jumpForce *= -1;
      to SwitchGravity script to invert Jump Force direction.

    • @miniminers7487
      @miniminers7487 4 ปีที่แล้ว

      @@Diedamni69 where do I put that in the code

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

    nice, how would you make a character be able to "fly", and toggle the "flying" ability on/off mid game?

  • @bunggo9914
    @bunggo9914 6 ปีที่แล้ว

    seems cool!

  • @theGreaterAwareness
    @theGreaterAwareness 4 ปีที่แล้ว +2

    It's like if Weasley from Harry Potter had some acid.

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

      Looks like, Wizards have no idea about collider..... :D

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

    I'm gonna try this out in 3D!! Thanks for the help! Hope it works out okay. Lol.

  • @lukedwsn
    @lukedwsn 5 ปีที่แล้ว +2

    When I put "top =!top; " under the if statement it tells me it is out of context. Any help?

    • @danielmartin6718
      @danielmartin6718 4 ปีที่แล้ว

      Try to find the end of the if statement when it closes the "}", then put it under it, not inside. If its right below it is considered part of the if code. That's what i did. My problem is also being with rotating the character upside down. Good luck bro

    • @griffinbrooks6748
      @griffinbrooks6748 4 ปีที่แล้ว

      make sure top is a boolean variable. and has a value

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

      @@griffinbrooks6748 im confused can you elaborate where to create the variable

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

    How would you simulate something as in Exo One? >_>

  • @chinyonglim7624
    @chinyonglim7624 6 ปีที่แล้ว

    Hi Noa,
    I having a question about the tutorial for AI shooting/follow/retreat.
    During the gameplay, we, the player or the AI will shoot projectiles to enemy, then once projectiles collide with the enemy, the enemy health point will be decreased.
    In our perspective, we will know that which player/AI had shot projectiles to which enemy.
    But how do the system knowing that which player/AI had shot projectiles and inflicted how much damage to the enemy? Like making system tracking log, so we can notice all players/AI behaviors in our game.

  • @lee1davis1
    @lee1davis1 6 ปีที่แล้ว

    I never could figure out how to script project settings. Thanks

  • @arashsh4513
    @arashsh4513 6 ปีที่แล้ว

    thanks for tutorial, but rotate can not work in OnTrigger function!!, what can I do?

  • @155-s4i
    @155-s4i 6 ปีที่แล้ว

    The Console says That the namespace Player could not be found. How do I fix it?

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

    The rotate script doesnt work, any suggestions ?

  • @andrej1668
    @andrej1668 6 ปีที่แล้ว

    Thank you :D

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

    Does physics2d.gravity scale affect other objects in scene or the gravity changes just for player ?

    • @saurabhsharma-qw1io
      @saurabhsharma-qw1io 3 ปีที่แล้ว

      The way it is done here it affects every object with a rigidbody.

  • @crispp9240
    @crispp9240 6 ปีที่แล้ว

    can you make a mouse projectile shooting thing on this player?

  • @batuhanegesen
    @batuhanegesen 5 ปีที่แล้ว

    Can we fake the gravity on horizontal axis?

  • @Gabriel-ServantOfGod
    @Gabriel-ServantOfGod 3 ปีที่แล้ว

    Man, our teacher is quite good but i had no idea you could touch gravity scale xdd, we changed all gravity direction in general... if i had known--

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

    TYSM

  • @rafaelskiarteportfolio1098
    @rafaelskiarteportfolio1098 4 ปีที่แล้ว

    PERFECT

  • @reywasgrey
    @reywasgrey 6 ปีที่แล้ว

    Nice tutorial as usually... But,, please answer my question in your video "2D double/triple jump platformer"
    I ask you about shadow

    • @Blackthornprod
      @Blackthornprod  6 ปีที่แล้ว

      Hey :) ! Sorry I missed that comment ! The shadows you see in that tutorial are actually just sprites with a low opacity, slightly rotated behind the platforms :)

    • @reywasgrey
      @reywasgrey 6 ปีที่แล้ว

      Ok, tx

  • @choyocruz3395
    @choyocruz3395 6 ปีที่แล้ว

    great vídeos. i like your channel. here is a question. im triying to do a ai to enemie. like a soccer game but in 2D. the idea is the enemie put the ball in the other goal position. may you help me? thanks a lot.

  • @varunsuresh22
    @varunsuresh22 4 ปีที่แล้ว

    Has anyone tried doing the gravity swap only for one specific sprite and not other sprites in the scene? I want only specific sprites to be gravity affected. Any suggestions folks?

    • @saurabhsharma-qw1io
      @saurabhsharma-qw1io 3 ปีที่แล้ว

      Did you find a way to do that. I am stuck at this.

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

    how would I make it so I can jump when gravity is flipped?

    • @saurabhsharma-qw1io
      @saurabhsharma-qw1io 3 ปีที่แล้ว

      You can have a different settings for jump and gravity changer. A dedicated key for jump and another for gravity changer or a single click will jump and double click will act as gravity changer.

  • @verlexin8398
    @verlexin8398 6 ปีที่แล้ว

    The player namespace cannot be found, any help?

  • @learnunity8487
    @learnunity8487 4 ปีที่แล้ว

    can you pls do a tutorial on gravity controller 3d

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

    Cheers :D

  • @roxsta9475
    @roxsta9475 6 ปีที่แล้ว

    Nice

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

    Thank

  • @jeppy4021
    @jeppy4021 5 ปีที่แล้ว

    But how to set this thing for a particular scene? I want this mechanic just for one level of my game

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

      you can create a collider in trigger that covers the entire scene, and then write a script so the "Gravity Controller" component in the character is activated only if he collides with this box :]

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

      @@danzin1331 hi, ik that this question is not the same topic as your comment but still if you could help that would mean a lot. My problem is that when i type private Player player unity doesn't recognize the word Player.

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

      Maybe your class isn't named Player or something like that

    • @CringeMaster64
      @CringeMaster64 5 ปีที่แล้ว

      @@danzin1331 By class you mean script right?

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

      Yep

  • @stanpersoons
    @stanpersoons 6 ปีที่แล้ว

    Can you make a vid on photoshop specific tips and tricks and character animations /disign Like the shadow and Colors to use ...... hope you see this 😃. Btw love your vids. Like if you also want to see this

  • @SafaAlkan
    @SafaAlkan 5 ปีที่แล้ว

    İ need 3D one for script and the other things

    • @IBK_TECHBYTES
      @IBK_TECHBYTES 5 ปีที่แล้ว

      did you figure it out

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

      @@IBK_TECHBYTES nope

  • @reamuji6775
    @reamuji6775 4 ปีที่แล้ว

    a bit idea from me, if you really want a fluid gravity change you could just rotate the camera and the whole level lol

    • @reamuji6775
      @reamuji6775 4 ปีที่แล้ว

      it might be laggy though

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

    Can you please send me the codes ?

  • @mr.casual2304
    @mr.casual2304 5 ปีที่แล้ว

    When I'm on the top platform I can't jump at all

    • @YnIanIo
      @YnIanIo 5 ปีที่แล้ว

      If your ground check component and script are bound to a certain tag and your ceilling doesn't have that tag in place it will not recognise it as ground from which you can jump. Make sure your tags correspond to what your script is asking for.

  • @Gloriaficent
    @Gloriaficent 6 ปีที่แล้ว

    Overwhelming! I just want to know how to fix having my gravity on as it was defaulted to. My sphere just glides used to glides forward a little before landing. That is not what I want, the collision isn't working it doesn't play a message when it lands showing the other tutorial is working the same as me on what happens to be on the same page turning book.

  • @通りすがりのゲームクリエイター
    @通りすがりのゲームクリエイター 2 ปีที่แล้ว

    It looks like a 3D version

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

    Its liturally just 1 line of code?!?!?!?

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

    Unity's Morgz

  • @155-s4i
    @155-s4i 6 ปีที่แล้ว

    It doesn't work

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

    Useless tutorial, I'm trying to do this exact thing but with 3d spave. And there's no rigid body thing called gravity scale.

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

    i need 3d

    • @saurabhsharma-qw1io
      @saurabhsharma-qw1io 3 ปีที่แล้ว

      Just use all the 3 axis. and it should work in 3D

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

    How do I make the player jump while gravity is switched?