Тёмный

(01) Stealth Game - Custom Character Controller (Unity, C#) 

Code With Ajay
Подписаться 8 тыс.
Просмотров 21 тыс.
50% 1

Ever wanted to make an epic stealth game from scratch and learn while you do so? Well... you've come to the right place, today we'll be creating a Kinematic Custom Character Controller in Unity from scratch in C#, no rigid bodies or the Unity's built in CharacterMotor. It's easy to implement but has advanced features.
____________________________________________________________
Join me on --
✄ codewithajay.com ✄ [DEV LOG WEBSITE]
✄ / codewithajay ✄ [TWITTER]
✄ / codewithajay ✄ [FACEBOOK]
----- LETS TRY AND HIT : 70 LIKES ✌ ---------
★ Upcoming Videos :
Building a Self Driving car With Neural Networks ❤
Development Log #2 ❤
Next part : • (02) Stealth Game - Cu...
See an awesome development log, where I build an open world game from scratch using Unity : • Video
See the Finished Product of todays episode : 1:10:15 - 1:11:28
The next part is even better and in order for you to see it you have to subscribe and tap that bell icon to be notified : www.youtube.co...
If you want to see something next episode, comment down below but if you don't I have some great ideas myself ;)
Links :
----------------------------------------------------------------------------------------------------
[CURRENT] Part 1 Project (w/ all scripts + scenes): ceesty.com/wsWvNr
[VIDEO] Previous Character Controller : ceesty.com/wsWbsi
[OUT-DATED] Old Character Controller Script : ceesty.com/wsWbxp
If you enjoyed this video please COMMENT down bellow exactly what YOU would like to see in the next episode and I'll add it in and shout you out!! I need your contribution in order for me to make this channel bigger and better for everyone ;)
----------------------------------------------------------------------------------------------------
If you really did enjoy the content, help make this channel bigger by tapping that like button it would really help me out :) Thank you everyone for your support.
Parts of the Video :
Setting up the scene : 1:31 - 5:35
Camera Controller : 5:52 - 13:24
Simple Movement : 13:24 - 18:27
Gravity Setup : 19:34 - 22:44
Ground Checking / Explanation : 22:54 - 28:55
Ground Snapping / Slopes / Testing / Explanation: 28:55 - 46:10
Collision Handling / Explanation - 46:16 - 58:38
Jumping AND Fixing Issue - 58:38 - 1:10:15
Finished Product : 1:10:15 - 1:11:28
Series Description -
This series was built to be an entertaining way of learning Unity while making an incredible game, you will learn how to make complex AI behaviour and write complex scripts such as custom character controllers w/ custom handled collision and slopes. All being essential skills to being a Pro Unity Developer.
Video Description -
This video is mainly focused on making the perfect character that will accompany us throughout the rest of the series. First we make the Mouse Look script which allows us to be in a third person view around the character. Then we make the custom character controller which is a script I worked very hard on, it support custom collision detection and slope support, jumping and more without the use of a character motor or rigid bodies! It is 100% kinematic and controlled only by the script. It's stable and has many features.

Опубликовано:

 

6 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 114   
@batchprogrammer108
@batchprogrammer108 6 лет назад
Comment your ideas for this game down below and I'll add it in the next episode for sure! :)
@Господинпроститерабано
Hi, is it just me or there is a bug? when going upward the slope and reaching ceiling, controller wont stop... any ideas how to fix?
@davidffortesmeireles5328
@davidffortesmeireles5328 5 лет назад
add controllers to mobile =]
@matthewwoodle6603
@matthewwoodle6603 4 года назад
Honestly, the amount of work put in here is great. Thanks for making this video, you're an asset to the entire community of Unity users
@gmjammin4367
@gmjammin4367 5 лет назад
Very upset to see not a lot of people talking about collision systems. I'm glad you've made this video, thank you.
@DualAnalogReviews
@DualAnalogReviews 6 лет назад
Currently working in unreal engine on a fps but I'm planning on hopping on unity with your tutorials. I just want to say that i really appreciate you going through the process of creating a custom character controller. There are VERY FEW tutorials on this and most are lower quality. THANK YOU. Seriously you are one of maybe 3 tutorials that exist in the subject.
@batchprogrammer108
@batchprogrammer108 6 лет назад
DualAnalogReviews Wow thank you very much for the kind comment! I wish you good luck with unity and your game 😄👍
@petertarany2313
@petertarany2313 6 лет назад
Everyone who ever programmed something had a moment like this: 18:14
@batchprogrammer108
@batchprogrammer108 6 лет назад
Peter Tarany Hahahah very true 😂
@cookieceleste
@cookieceleste 2 года назад
Nice tutorial, I am starting to learn programming and although english is not my native language videos like this help me a lot. For now I will keep using more simple character controllers made from scratch but I am sure I will visit your channel again in the future to make and use this incredible character controller
@kaidastudios
@kaidastudios 4 года назад
Using unity2020, this works. Long tutorial but well worth it. Finally an amazing designed controller! This will be the base for all my future games, subscribed.
@CamoflaugeDinosaue
@CamoflaugeDinosaue 6 лет назад
This series looks very promising, and I love that you seem to value simplicity, very underrated. Don't think I've ever followed an hour long tutorial and had so few discrepancies in my own project by the end of it. I'm sure I'll have a ton of questions as I continue the series, but very nice job with this vid!
@batchprogrammer108
@batchprogrammer108 6 лет назад
Kevin Thank you very much Kevin! Very motivating for me :) I'm glad you enjoyed it and I will be more than happy to help you with any questions. Have a great day! :D
@batchprogrammer108
@batchprogrammer108 6 лет назад
For people who noticed that when you use the vertical and horizontal input the character moves faster, all you have to do is use the Vector3.ClampMagnitude function on the line where we collect the input information and you will pass in a maxVelocity which can just be a public float that you can access. *Do not normalise the vectors as this will ruin the way your character moves and will feel extremely unrealistic*
@DjSamvy
@DjSamvy 6 лет назад
I really love these videos and wish you could make them at a faster rate! I also have some stuff to suggest. (This comment is only such a wall of text because I pasted actual code) This is a little bit nitpicky, but I think that rather than simply clamping the input vector to a constant you should clamp it to whichever Input.GetAxis is higher. This way you won't accelerate faster when starting to move diagonally. (You'd reach top speed just a little tiny bit faster if you simply clamped to say 1f but with this method you don't accelerate any faster in any direction) What I think you should definitely do for gravity/jumping: (not accounting for anything special like moving platforms or walls obviously) //At the end of FinalMove() //Don't multiply velocity.y by movementSpeed, unrealistic velocity = new Vector3(0, velocity.y, 0); //see Gravity() } private void Gravity(){ if(grounded == false){ //Gravity should be acceleration not a constant speed, so only resetting velocity.y when grounded (and if hitting a ceiling) is IMO a good idea velocity.y -= gravity * Time.deltaTime; } else{ velocity.y = 0; } if(velocity.y > someFallingSpeedLimit){ //Idk what number to put here but it sure isn't good to clip through floors because you're going so fast velocity.y = someFallingSpeedLimit; } } private bool inputJump = false; private void Jump(){ bool canJump = false; //Not sure if you fixed this but it should probably be playerHeight/2 (+ someFloat possibly) because the ray starts at the middle of the player canJump = !Physics.Raycast(new Ray(transform.position, Vector3.up), playerHeight / 2, discludePlayer); if(grounded){ inputJump = false; } if(grounded && canJump){ if(Input.GetKeyDown(KeyCode.Space)){ //All you really need to do is inputJump = true; //I think that 0.6f up is way too much and it would be better to tinker with the collision system rather than teleporting your player upwards for that long of a distance but it does help avoiding instant grounding when jumping so you'd have to do something else to avoid that to get rid of this line transform.position += Vector3.up * 0.6f; //Simple but effective velocity.y += jumpForce; } } else if(!grounded){ //Incrementing your velocity.y is already done by gravity so you don't need to do anything here } } //Edit: Jesus christ, RU-vid autoformats tabs to spaces? Goodbye, all readability... Also, why would you use a sphere to check for collision on a character who resembles a capsule? (or *is* a capsule at the moment) You'd move through objects that only hit your head/feet, no? My very complicated test of just swapping the sphere for a capsule seemed to work perfectly. "Rant" ends here. Spent way too much time on this, but then again some of your videos are over an hour long so long feedback can be expected I guess. I just want to say again that I absolutely love your videos (especially the node editor and IK ones, they're awesome) and hope you'll keep making more :) Plz answer fast! No specific reason but still.
@batchprogrammer108
@batchprogrammer108 6 лет назад
Samvyx Samvyx Wow! Brilliant feedback, I hope this is a fast enough reply it’s 4:29 am at Australia ;) , I have slowed down the uploading for now because i am currently developing my website which is very important for me to progress but as soon as i finish it, I will be finishing off most of these tutorials. Most of the problems that you mentioned I have noticed and I even fixed a few of those problems in later episodes. The question about why i use the sphere collider is because when it comes time for stair climbing implementation you don’t want collision with stairs you need to be able to slightly clip through in order to smoothly traverse stairs without any rig for now and actually once we come to rough terrains a sphere collider will be much more suitable. I love all your code feedback and the idea of the clamping is great I will implement all of your fixes along with a handful of other suggestions i have received and of course like usual I will credit you fully for your hard work. I’m glad you are enjoying this series and my videos :) Thank you again and have a great day
@gnightrow4020
@gnightrow4020 6 лет назад
this character controller system seems like the best one I found so far thanks !!
@batchprogrammer108
@batchprogrammer108 6 лет назад
You're welcome! :)
@gnightrow4020
@gnightrow4020 6 лет назад
this is awkward , I typed out all of the code but for some reason my character can't turn, when I copy and pasted your code from your download file it still doesn't fix the issue, any Idea what I did wrong ?
@batchprogrammer108
@batchprogrammer108 6 лет назад
gNightrow Well the turning code is actually written inside the camera controller script so maybe you should check that script
@deadsec2532
@deadsec2532 3 года назад
hey nice work ajtech looking forward for more fun stuff from u
@jonsimcox725
@jonsimcox725 5 лет назад
Great Video, good pace, well explained and a good jumping off point.
@AlanAlan-bv9yg
@AlanAlan-bv9yg 3 года назад
You and Sebastian are great!!
@DJLKM1
@DJLKM1 5 лет назад
Very fast tutorial, great end solution though. I had one issue but i fixed it, character jumped but never came back down lol, im looking at implementing this controller in my new project which is going to be a type of Fallout 4 clone but with extra functions, like driving/flying etc. Thanks so much for this tutorial, your subscriber count is < you deserve.
@batchprogrammer108
@batchprogrammer108 5 лет назад
Thank you very much for the compliments, I wish you the best of luck with your new project (sounds awesome)!
@theRalphinader
@theRalphinader 4 года назад
This is a very helpful video that singlehandedly manages to be packed full of information and easy to follow. Quick question: I am no c# expert, and debugging manually is something I simply am not capable of. The timeframe of scripting in the video that concerns this is around 42:00. When I click play, my capsule spawns, then shoots up into the air indefinitely. I believe it's something to do with the spherecast hitting the capsule or perhaps the raycast, but I have the Disclude player mask configured (as far as I can tell) correctly. The Unity console says everything is fine, so It's almost certainly something that I left out or did wrong. I know that this comment leaves out a lot of information, which is why I'll probably post my code to the forums, but I was just hoping this was a common problem that had a simple fix. If this isn't the case, and there simply isn't enough information for a RU-vid comment to fix, I understand. Thank you for your time.
@GabrielRodriguez-mq6ly
@GabrielRodriguez-mq6ly 5 лет назад
I heavily modified this character controller for my own needs and thanks to you i have a character controller that feels as smooth as the 60$ ones on the asset store!!! By any chance, is there a way to stop sliding down slopes if they arent too steep?
@pittyconor2489
@pittyconor2489 5 лет назад
Thank you!
@percasy8989
@percasy8989 6 лет назад
Wow. How did I JUST now find your channel! I've been missing out. Great Video! :)
@batchprogrammer108
@batchprogrammer108 6 лет назад
Thank you very much :)
@littlegreen4899
@littlegreen4899 3 года назад
Suggestion if you run into some jittering instead of just update do fixed update
@simonholmqvist1951
@simonholmqvist1951 6 лет назад
Cool game!
@batchprogrammer108
@batchprogrammer108 6 лет назад
Thank you :)
@sondre2902
@sondre2902 5 лет назад
Hello, watching this after i saw your 3 latest videos! And im sitting here wondering... how did you learn all this? By yourself or from a person? How do you reccomend that I learn to get the most out of my time? Thanks!:)
@batchprogrammer108
@batchprogrammer108 5 лет назад
Thank you for watching all my videos Sondre! I learnt most of it by myself just going through hundreds of RU-vid videos & documentation over a few years, I really recommend learning through example - just think up a challenge in your head & then learn how to do it by just searching questions on Google and RU-vid, that's how I did it atleast :)
@mindpixel523
@mindpixel523 6 лет назад
This was amazing! Is it possible in the next or future episode to add Camera Collision to prevent the camera from clipping or going through objects?
@batchprogrammer108
@batchprogrammer108 6 лет назад
I just released a new video before you commented so I will add it in Episode 3 :) which will be coming out in the next 1-3 days hopefully
@mindpixel523
@mindpixel523 6 лет назад
Thanks AJ!
@batchprogrammer108
@batchprogrammer108 6 лет назад
You're very welcome :D
@mindpixel523
@mindpixel523 6 лет назад
Hey AJ! Hope all is well. Quick question on the Character controller. For some reason my character doesn't collide with the ground and just goes right through slowly until he disappears. I added the references to my box collider. Any ideas? Thanks!
@batchprogrammer108
@batchprogrammer108 6 лет назад
Mind Pixel Okay so this may be caused by the mesh collider or the box collider, try removing the mesh collider and see if it works but if not then make sure the box collider does not wrap all the way to the bottom of the cat as if the box collider touches the ground then it will start to compute penetration with the ground. So I think you should get rid of the mesh collider and then bring the box collider height down so that it just goes around the top half of the cat and manually increase or decrease the height in the inspector on the player controller script. :) Hope this helped.
@CJBurkey
@CJBurkey 6 лет назад
But you never normalize the input data, if the player moves diagonally, they'll move at a speed of _sqrt(2*(moveSpeed^2))_ , not _moveSpeed_ .
@batchprogrammer108
@batchprogrammer108 6 лет назад
CJ Burkey Oh thank you for pointing that out! I'll fix it in my next episode, thank you :)
@thomasprindeville1468
@thomasprindeville1468 5 лет назад
Correct me if I'm wrong because I most likely am; A good way to see what a normal is, is to create a plane when the plane is visible you can see the normals when the plane is not visible you cannot see the normals.
@batchprogrammer108
@batchprogrammer108 5 лет назад
Yep you are pretty much correct, but 'normal' aren't exactly something you can 'see', it's more of a direction that tells a rendered what direction the faces are pointing in. In the case of the plane, since it is 2D the face only has one normal direction - so only the side that has the normal direction facing 'up' is shown. I hope this helps :)
@thomasprindeville1468
@thomasprindeville1468 5 лет назад
@@batchprogrammer108 I was having some problems with my character falling through the cube. Is it because I'm using a model and not the capsule?
@batchprogrammer108
@batchprogrammer108 5 лет назад
@@thomasprindeville1468 Well are you still using the same colliders that I use in the video?
@misterpandattack
@misterpandattack 5 лет назад
This is so nice dude! Struggling to add a sprint. When I change the movementSpeed it is also affecting the jump. Cannot not figure out how to only affect x and z. Any ideas? :)
@jroy7408
@jroy7408 5 лет назад
Hi there, Nice tuto, really useful! A question though, that might be silly but i cannot collide with trigger box, i was wondering if i missed something whether it'd be with layermasks or anything else? It is kinda annoying since neither of OnTrigger or OnCollision seemed to work with this CharacterController even though i put the triggers on Player layermask or not.... Any ideas why? Thanks a lot!
@vladg6
@vladg6 6 лет назад
i copied the code for your character controller ,but there is a small problem , my character doesn't jump , do you know why that might be ?
@batchprogrammer108
@batchprogrammer108 6 лет назад
Yes, the problem that you are facing is that, the clamp to ground function is acting as soon as the jump function is used. So as soon as it jumps, it snaps back down :( There is a fix for it. I hope I can explain this to the best I can -> Create two jump functions, one for input and one for movement - Run the input jump function in the Update() and as soon as space is pressed set the jump=true, and make sure that clamping cannot occur anymore. In fixedUpdate() create a new function which does the movement of the jump if jump==true and when the jump completes set jump=false. This is how I solved it, my explanation was a bit vague but I hope it helps you, even I had this problem for a while. Thank you for the subscribe as well :)
@blablabla1196
@blablabla1196 4 года назад
For anybody that is having trouble matching him. Be very very very careful that you are coding exactly what he is doing. I found that the way I organize is a bit different, but when I followed him exactly, it all worked fine and barely had to tweak much. There were cases where I put "num" instead of "null" or I accidentally placed an "if" statement outside of the "for" loop. Just be extremely cautious.
@lefterisk1872
@lefterisk1872 6 лет назад
How do you learn so much about coding and unity?
@batchprogrammer108
@batchprogrammer108 6 лет назад
Lefterisk I mostly learnt everything I know by making games by watching tutorials for a couple of years and eventually I just it picked up 😂
@dylonm9701
@dylonm9701 4 года назад
I know it's a rather old video, but i've used this controller on a more shaped polygonal model on a polygonal surface. The character seems to jitter a bit up and down on some surfaces. Also, is there any way to turn the sphere collider into something more like a mesh collider or even a capsule collider? Any help would be greatly appreciated! (I know little to nothing about programming. Just basic Python. Just needed a great controller and camera to play with.)
@nickgennady
@nickgennady 4 года назад
Will this able to interact with rigid bodies?
@Swerik
@Swerik 3 года назад
Could you please fix the order of videos in your Stealth Game Plalist? 1-8 would make the most sense not 4-1 then 5-8 ;D
@batchprogrammer108
@batchprogrammer108 3 года назад
Ah yes, I will do this, sorry about that haha
@davidffortesmeireles5328
@davidffortesmeireles5328 5 лет назад
this is good to moblie?
@roryedmonds9415
@roryedmonds9415 4 года назад
Hey AJ my character tends to clip through floors when moving fast enough or at the right angle, got any ideas on how to fix this? Any help would be much appreciated
@KProductionsStyle
@KProductionsStyle 6 лет назад
my collision does not work i think it is something with the snapping because it snaps to random places and on top of the test wall
@KProductionsStyle
@KProductionsStyle 6 лет назад
I finally found where i messed up on the penetration vector line i did transform.position += transform.position + penetration Vector instead of transform.position = transform.position + penetration Vector;
@shreeshavenkatram848
@shreeshavenkatram848 4 года назад
hey man my capsule is clipping through the ground after completing the jump please help man!!
@NotASpyReally
@NotASpyReally 6 лет назад
I loooooooooove you
@batchprogrammer108
@batchprogrammer108 6 лет назад
Hahahah thankssss :D
@michaelgreenhut883
@michaelgreenhut883 4 года назад
At 43:26, for some reason, my capsule bounces repeatedly if I use your settings, especially the height of 2. I had to fix it by setting the radius in the OverlapSphereNonAlloc call much higher, to 0.9, and now it moves and climbs smoothly. What concerns me is why different physics seem to be happening with the same code and same settings as in the video.
@highimpact1
@highimpact1 2 года назад
Same here. Almost everything that he presented here was off for me.
@Jawsarn
@Jawsarn 6 лет назад
Is this your most recent and advanced character controller walkthrough? I really think you should either clip and paste your videos or do a proper walkthrough off camera before you do these. You should consider walking through on paper and pen between as well.
@batchprogrammer108
@batchprogrammer108 6 лет назад
I'm confused as to what you mean? Did I make a mistake somewhere?
@Jawsarn
@Jawsarn 6 лет назад
AJTech first was just a general question, when your going forth and back it feels like it's not thought through. The others were just means of improvement for quality and understanding for the viewers
@batchprogrammer108
@batchprogrammer108 6 лет назад
You are absolutely correct, thank you for the feedback :) In my more recent videos I have thought out the videos more clearly
@Jawsarn
@Jawsarn 6 лет назад
Sweet, so was there any more recent walkthrough? Or was the previous one more advanced? Also in 4:40 something you give a rather weird explenation to the code, with a scenario I can't really see happening. Could you further explain how this would occur?
@Jawsarn
@Jawsarn 6 лет назад
And now when I'm thinking about it and doing some of my own, it feels like the whole GroundConfirm is kind of redudant in some way. You could simply make a smaller SphereCast in your GroundChecking function. What I do is have a "max walk height" which I start the ray at from the bottom, and then cast that ray. I don't understand why you would need the other checks if you just do the first one right?
@okayperson522
@okayperson522 6 лет назад
Hello AJ, I emailed you a player controller script that I am working on! I've had some issues with the collision detection in this video and it would be great if you could help me out.
@batchprogrammer108
@batchprogrammer108 6 лет назад
I have replied :)
@roryedmonds9415
@roryedmonds9415 4 года назад
Hey man i know this is very late but what was the solution to your collision detection issues because i think i have similar issues
@BigWllyTM
@BigWllyTM 5 лет назад
Im having a problem on the camera controller coding when i use private void lateupdate it says that private is not valid for that item
@batchprogrammer108
@batchprogrammer108 5 лет назад
private void LateUpdate() { } and void LateUpdate() { } should both work :)
@thelegenderycheasecake6543
@thelegenderycheasecake6543 5 лет назад
thank you so much [=
@batchprogrammer108
@batchprogrammer108 5 лет назад
You're very welcome :)
@SotoAnimation
@SotoAnimation 6 лет назад
Awesome stuff! How often do you plan on uploading videos for this series?
@batchprogrammer108
@batchprogrammer108 6 лет назад
Thank you! I am currently uploading every 1 - 3 days. I have already uploaded the next two parts :)
@SotoAnimation
@SotoAnimation 6 лет назад
Awesome!! Looking forward to more!
@ggdevelopment7403
@ggdevelopment7403 5 лет назад
well this doesn't work... I'm at 42:24, and for some reason there is no snapping to the ground... My capsule just fall right through the ground. Any suggestions? The ground is in the right layer... I even tried to download your script and importing it to my assets, but it still won't work
@imatt1990
@imatt1990 5 лет назад
I had the same problem. In case you haven't solved it, in Unity, make sure that your player is on the Player layer and discludePlayer has "Everything" and "Player" deselected.
@michaelgreenhut883
@michaelgreenhut883 4 года назад
Same problem , same spot, code is verbatim the same. Player capsule just falls right through the floor. I think there's something missing in the video. UPDATE: The gravity setting in the video is the problem. 2.5 makes it fall through the floor, 2.0 works. The other solution is to use FixedUpdate instead of Update. Possibly different Unity versions handle the finer points differently here. I'm on Unit 2019.2.
@mindpixel523
@mindpixel523 6 лет назад
Hi AJ! I emailed you regarding a camera follow script I am working on. I hope you can steer me in the right direction on some questions I have. Hope all is well!!
@batchprogrammer108
@batchprogrammer108 6 лет назад
Mind Pixel Absolutely I will check it out this afternoon :)
@mindpixel523
@mindpixel523 6 лет назад
Okay! So I have the controller working but for some reason when I collide/slide across a wall it stutters and jumps fast, any ideas?
@batchprogrammer108
@batchprogrammer108 6 лет назад
So how are your colliders set up? Can I have a photo of your characters displaying where all your colliders are and the variables on the actual script that would help me a lot thanks :) - bestbatchprogrammer101@gmail.com Just comment again when you have emailed me
@mindpixel523
@mindpixel523 6 лет назад
Okay, sent you an email! Let me know if you need any other details.
@batchprogrammer108
@batchprogrammer108 6 лет назад
Mind Pixel Thanks! I'll recreate the issue on my computer and then I'll fix it and send you a solution. :)
@mindpixel523
@mindpixel523 6 лет назад
Thanks!
@batchprogrammer108
@batchprogrammer108 6 лет назад
Hey MindPixel! Just wondering if you got the controller working yet :)
@SotoAnimation
@SotoAnimation 6 лет назад
How would you make it so the jump isn't so poppy?
@batchprogrammer108
@batchprogrammer108 6 лет назад
I actually fix that in Episode 4 which is coming out tomorrow + some other fixes / improvements so hold on just a day and I'll fix it all :)
@SotoAnimation
@SotoAnimation 6 лет назад
Cool stuff no worries! Keep it up!
@batchprogrammer108
@batchprogrammer108 6 лет назад
I just want to apologize for the delay, I finished recording but I didn't like the quality of the video so I restarted. But here is the fix : Find this section in the jump of the player controller : if (Input.GetKeyDown(KeyCode.Space)){ inputJump = true; transform.position += Vector3.up * 0.6f * 2; jumpHeight += jumpForce; } And all you have to do is just remove the ' * 2 ' from the end of the ' transform.position += Vector3.up * 0.6f * 2; ' So : if (Input.GetKeyDown(KeyCode.Space)){ inputJump = true; transform.position += Vector3.up * 0.6f; jumpHeight += jumpForce; } The new episode will also teach at the end how to improve the jump so it gains fall speed over time. Sorry about the wait, if you need anything else please don't hesitate to ask :)
@SotoAnimation
@SotoAnimation 6 лет назад
All good no worries! Thanks for the update!
@ArisingHeroBeAHero
@ArisingHeroBeAHero 6 лет назад
i removed the 2 and it snaps me back to the floor. also I had to change 0.6 to 0.8 and now it works. but it is still poppy.
@JACKRAIDEN97
@JACKRAIDEN97 6 лет назад
Github?
@batchprogrammer108
@batchprogrammer108 6 лет назад
github.com/AJTech2002/Stealth-Series
Далее
(02) Stealth Game - Custom Behaviour Editor (Unity, C#)
27:06
Mcdonalds cups and ball trick 🤯🥤 #shorts
00:25
Просмотров 1,3 млн
I Remade YouTube From Scratch Using Just Bash
17:51
Просмотров 28 тыс.
I Paid Fiverr Game Developers to Make the Same Game
10:25
How to Start Making Games with No Experience
10:55
Просмотров 88 тыс.
Smooth PORTALS in Unity
24:53
Просмотров 456 тыс.
Unity3D Character System On Slopes!
23:03
Просмотров 55 тыс.
Mcdonalds cups and ball trick 🤯🥤 #shorts
00:25
Просмотров 1,3 млн