- Видео 5
- Просмотров 163 984
ShootingDux
Великобритания
Добавлен 9 апр 2020
Unity 2D Movement Beginner Tutorial - Physics Based
This is a beginner tutorial for moving a character in a top down 2d unity game. There are a few different ways you can move a player in a 2d unity game and we've taken one of the physics based approaches in this video by adjusting the velocity of the Rigidbody2D attached to the player. This is a beginner tutorial to get someone started quickly.
Chapters:
0:00 Intro
0:10 Rigidbody2D
0:24 PlayerController Script
1:35 Read Input
2:35 Physics Movement
3:11 Move Player
WHO AM I?
I'm Michael and I'm a software developer living in the UK. I make videos about game development in Unity, productivity and other aspects of life. I write a monthly newsletter eepurl.com/hg_QTb that covers what I'm doing with th...
Chapters:
0:00 Intro
0:10 Rigidbody2D
0:24 PlayerController Script
1:35 Read Input
2:35 Physics Movement
3:11 Move Player
WHO AM I?
I'm Michael and I'm a software developer living in the UK. I make videos about game development in Unity, productivity and other aspects of life. I write a monthly newsletter eepurl.com/hg_QTb that covers what I'm doing with th...
Просмотров: 23 740
Видео
Easy Unity 9 Slice Tutorial for Beginners
Просмотров 9 тыс.2 года назад
This is a short video to explain how to go about getting Unity 9 Slicing working. I've had issues in the past with unity 9 slice not working and wanted to put this quick video together to explain how to go about getting 9 slice set up in Unity. This video walks what to do when you import the image, how to set up the 9 slice image, then I add it to the 9 slice image to the UI as an image on the ...
Flip 2D Character Unity - Animation Tutorial
Просмотров 17 тыс.3 года назад
In this tutorial video we walk through how to set up a 2d character animation from a sprite sheet. We take the sprites from the spritesheet and create a player run and idle animations. Then we look at the animator and create the transitions between the animations. After that's all working we create a player controller script to move the player and update the animations. Finally we look at how t...
Unity Sprite sheet Slice - How to slice a sprite sheet in Unity
Просмотров 63 тыс.3 года назад
In this video we'll look at how to slide your sprite sheet in Unity. Unity Sprite Sheet Slice shows you everything you need to do from importing your artwork, setting up the sprite sheet in Unity by showing the values that need to be set in the inspector. Then we use the sprite editor to actually slice the sprite sheet into individual sprites. Lastly we take a look at how to use the sprite in y...
Unity Sprite Layering - Y Sorting, Sorting Layer and Order in Layer
Просмотров 52 тыс.3 года назад
Learn how to order your player sprites to be able to walk behind objects. Understand how unity sprite layering, order in layer and the sprite sort points work. In this video we go over how sprite layering is prioritized, what a sorting layer is. How to set the sprite order in a layer and the sprite sort point so that you can get your player and NPC sprites to walk behind other objects. Chapters...
that worked for me thanks alot
Thank you for your help! My project needed the 2D Sprite package installed from Package Manager and then the Sprite Editor was made available! 🙂
I had no idea it was this simple, thank you!!
Were should i add Time.DeltaTime
In this example you don't need to use deltaTime. DeltaTime is only needed if your changes are directly affected by framerate (e.g. you set position of the object directly). If you change velocity of rigidbody, you should not care about framerate - Unity will update your rigidbody position on its own, using velocity you've provided. In general, deltaTime is very tricky when working with physics. Usually you either don't need to use deltaTime at all, or you should do physics logic in FixedUpdate, where deltaTime is not always needed.
What can i do? My player have a height of 2 tiles. If i go behind a tree with a lets say 6 tiles height i just cant sorting the bottem tile wiith the colloder part. How can i solting the second tile, the tile with the tree trunk?
tk
How do I make the movement speed faster?
after [SerializeField] private float movementSpeed =, make it a bigger number like 6f instead of 2f
Used this to implement Kenney's Fantasy UI into my project, worked great. Thanks!
Thanks for the tutorial. I'm also doing my final project and was too dumb to make my own animation so i just downloaded an already made and was stuck on how to slice them. HUGE W!
Thank you!
It was very very helpful! I was just making new CameraManager for this feature from ZERO, and noe I don't have to waste time anymore!!!
That kinda works, but what it does is it sorts by center, which is not always accurate. It should sort by the bottom of the sprite. I guess the only way to do that is to modify sprite's pivot point? But that's a weird solution, what if I would like to rotate that sprite afterwards and it would look really weird?
personally i prefer using GetAxisRaw and do my own smoothing in script but it's prbably too complicated for a beginner
please more
is there a benefit to using velocity rather than addforce?
I struggled since days trying to figure out how to handle the sorting order by code and you just show me a way the engine does it itself. I thank you for this, from the bottom of my heart!
thank you so much for the tidbit about the pixels per unit. you've just saved me so much headache ♥
you don't make videos but thanks for this one! Forever cherish
This is super helpful! One thing I'm interested in after getting this to work is that the movement appears to have some Ease in / Ease out to the player input, so when I start moving it kind of ramps up to speed, then when I stop moving it ramps down the velocity very briefly before coming to a true stop. I'm wondering what would be the best way to make that movement pattern linear instead?
Wow this is amazing. I was doing this the really annoying hard way where I was in code manually changing stuff. And here Unity literally gives you this for free.
The drag and drop specific sprites in a multi sprite sheet was key for me. Thanks for the tip / tutorial
Absolutely a lifesaver tutorial
you are the GOAT tysm!
thanks dude! this was soooo helpful for my computer science coursework 😄
Can you save this animation as a gif?
thanks a lot
I spent way too much time trying to figure out how to slice my spritesheet on my own and this 6m video solved all my issues. Thanks a lot! (you literally made me login to leave a comment)
something you could do is have a file of the code that you put so some people dont have to type it and make it easier for them so they dont have to nit pick every single line of code jsut for it to work for them.
TYSM
how can i get 999 error on tihs code...
When I use Sort Axis it only works when I put the objects exactly in the middle otherwise when the objects are on the top half, I move over it, when the objects are on the bottom half I move under it can someone please help
it doesnt work with urp?
I would recommend putting a .normalized behind movementDirection at line 23. If you don't do this, the player will move faster diagonally because it combines the horizontal and vertical speed.
This is magic! Small correction @ 2:50 , x and z are 0. and y set to 1.
How do i do if i have multiple assets being instantiated but because of the collinder they get one on top of the other, but i'd like them to be side by side also in the Z, but as a 2d game would order in layer be enough? i have changed the orders when clonning them but no deal
didnt work :(
Ty sir!
Really great and quick tutorial ! Thanks for your help, i was being stuck on that part for quite a long time !
Game NOW WORK
fails to run and says 'This" does not contain a definition for transform
skill issue tbh
thanks for the vid <3 could not for the life of me remember how to do this and needed this refresher.
very simple and straightforwarded tutorial, really like it. thank you so much!
For others that maybe came here and didn't get the answer they needed on why their sprite is flipping "too far". Check the pivot point of the sprite that you imported and change it to "Center". I've looked through so many videos and was surprised to never see it mentioned lol. Mine was set to bottom left, so I was trying to flip it and then reposition the sprite and it was not something that I'd seen done anywhere so I knew it had to be something weird on my end.
do the capitals matter?
yes they matter a lot if there not capitalized then it'll try and find a different variable/instance
always come back, like a reminder, I should do my own videos like you did, so, I can recur for it to remember these settings 🤦♀
I just started to learn unity and your videos helped a lot! Thanks for the tutorial, really appreciate it. Now I have a small issue, when the animation is flipped, it starts to jitter... Drives me insane :D I tried to google this out, but just made a bigger mess :(
THANKS!!!
i did the exact same thing and it doesnt work...
man, totally forgot that Unity doesn't have an automatic feature for slicing sprites. Jeez
Thank you.
You're welcome!