This video is perfect! Thank you so much for sharing the knowledge!! Love it, super well explained and fun to watch!!
@_sophies2 жыл бұрын
Just wanted to say this is the best character controller tut that I've seen, and all the character controllers I've made since watching this have been based off of this.
@gabrielplourde67913 жыл бұрын
This was very intelligently designed and explained. So many subtle changes that really bring it all together to near perfection, I love it
@MythicLegionDev3 жыл бұрын
Awesome explanation and solutions, thank you for sharing! I've been developing a similar physics based character controller by trying to combine my favorite parts of a responsive platformer controller and a raycast vehicle controller so this is all super helpful!
@unexpectedme99923 жыл бұрын
Upload now bro
@tdif3197 Жыл бұрын
You guys have a great set of tutorials here. Glad to find another floating capsule user, it really is the way to go.
@bubski382110 ай бұрын
this is one of the smartest custom controllers I've ever seen, so impressed with yall's work on this
@kerduslegend26449 ай бұрын
man, this is such a hidden gem. i dont know why i dont know your channel earlier
@monochroma38032 жыл бұрын
i like how technical explanations are and art style is so cheerful and fun to watch ! good job !
@joshrs926 Жыл бұрын
Thanks a lot for this video. It's great! Here's my version of vertical hovering after following along. I researched a bit on spring-damp mechanics and was able to define the behavior using frequency and a damp factor rather than spring strength and damp strength. This way, you set dampFactor to 1 and it will reach equilibrium without over shooting. Set dampFactor to 0 to get a spring that (ideally) never loses energy. dampFrequency defines how fast it reacts. using UnityEngine; public class Hover : MonoBehaviour { public float dampFactor = 1; public float dampFrequency = 15; public float hoverHeight = 1.5f; public float maxDistance = 2; public float castRadius = .5f; public Rigidbody rb; RaycastHit[] hits = new RaycastHit[10]; private void Awake() { if (!rb) { Debug.LogError($"[{nameof(Hover)}] missing field RigidBody."); enabled = false; } } private void FixedUpdate() { ApplyHoverForce(); } void ApplyHoverForce() { if (GroundCast(out RaycastHit hit)) { Vector3 rayDirection = Vector3.down; float springDelta = GetSpringDelta(hit); float springStrength = SpringStrength(rb.mass, dampFrequency); float dampStrength = DampStrength(dampFactor, rb.mass, dampFrequency); float springSpeed = GetRelativeSpeedAlongDirection(rb, hit.rigidbody, rayDirection); Vector3 springForce = GetSpringForce( springDelta, springSpeed, springStrength, dampStrength, rayDirection); springForce -= Physics.gravity; rb.AddForce(springForce); if (hit.rigidbody) hit.rigidbody.AddForceAtPosition(-springForce, hit.point); } } bool GroundCast(out RaycastHit hit) { int hitCount = Physics.SphereCastNonAlloc( transform.position, castRadius, -transform.up, hits, maxDistance); if (hitCount > 0) { for (int i = 0; i < hitCount; i++) { RaycastHit current = hits[i]; if (current.rigidbody == rb) continue; hit = current; return true; } } hit = default; return false; } float GetSpringDelta(RaycastHit hit) { return hit.distance - (hoverHeight - castRadius); } static float GetRelativeSpeedAlongDirection( Rigidbody targetBody, Rigidbody frameBody, Vector3 direction) { Vector3 velocity = targetBody.velocity; Vector3 hitBodyVelocity = frameBody ? frameBody.velocity : default; float rayDirectionSpeed = Vector3.Dot(direction, velocity); float hitBodyRayDirectionSpeed = Vector3.Dot(direction, hitBodyVelocity); return rayDirectionSpeed - hitBodyRayDirectionSpeed; } static float SpringStrength(float mass, float frequency) { return frequency * frequency * mass; } static float DampStrength(float dampFactor, float mass, float frequency) { float criticalDampStrength = 2 * mass * frequency; return dampFactor * criticalDampStrength; } static Vector3 GetSpringForce( float springDelta, float springSpeed, float springStrength, float dampStrength, Vector3 direction) { float tension = springDelta * springStrength; float damp = springSpeed * dampStrength; float forceMagnitude = tension - damp; Vector3 force = direction * forceMagnitude; return force; } }
@diegorg644 ай бұрын
Thanks for your implementation of vertical hovering. I'm having some problems for movement on slopes. When I go up a slope, the character stays too close to the ground, and when I go down, it stays too high, causing the character to make small falls. My parameter values are: maxDistance = 1.5f hoverHeight = 1.2f dampFrequency = 15f dampFactor = 0.55f
@FlipYourLearning3 жыл бұрын
Nice video. The code is well written and although I had seen this approach in other tutorials none could explain it as well as you did.
@simpathey3 жыл бұрын
This is so exciting! I am pumped for the game, and thanks for talking in depth about your physics based movement and even showing code. I will for sure give this a go in my next game!
@reggieisnotadog4841Ай бұрын
This was SO HELPFUL! The hardest part for me was making sure my graphics stuck to the ground (given that that the capsule bobs about a bit), but now I've gotten there it's the perfect combo of physics and control. Love it, thanks again for making the video.
@AForceofWill2 жыл бұрын
I have never thought of using floating capsules... this is so ingenius! I can't believe my solution to rough player controls was this simple. You are amazing sir!
@Foxyzier2 жыл бұрын
Can't stress enough how grateful I am for this video, there really isn't enough explanations on physics based character controllers like that.
@groovykush2 жыл бұрын
The most structured and detailed tutorial i ca across until now. Thank you very much!
@theDarkerSan2 жыл бұрын
I combined this with ground normals movement (ground raycast hit normals plane projection ) and it turned out amazing! thanks again.
@mattsYT422 жыл бұрын
could you please explain that in lamen's terms 😅
@sutoreikyatto2 жыл бұрын
I feel so lucky that this video exists since I've been struggling on implementing a physics based first person controller and this tutorial explains almost all the issues I've faced. Thank you so much!!
@spacewizards90398 ай бұрын
Wow, very impressed. The game I'm working on uses (mostly) hover vehicles, so I was already using a setup similar to yours (floating "characters" with continually calculated strength and dampening forces). But you guys have really taken it to the next level with improvements that I hadn't thought of at all. Thanks!
@TrentSterling3 жыл бұрын
Great visualizations! Looking forward to implementing something similar!
@supercables25110 ай бұрын
+1 sub for being the only correct character controller I've ever seen talked about.
@yaderkunsama94542 жыл бұрын
I've been looking for an explanation, a hint on physics based movement for the past 3 months. This has really helped figure out how to do it, at least gave me a starting point. Thanks for the explanation!
@budhechiranjiv3 жыл бұрын
Nice, Good luck with your release!
@pomonaprod2 жыл бұрын
The hovering capsule mechanic is really clever. Finally found something that works for my project. Thanks for sharing. Amazing video. Great Explanation !!!
@ali32bit42 Жыл бұрын
i was so lucky this studio exists cause i keep coming back to this as refrence for my own game.
@megasoniczxx2 жыл бұрын
I still don't get completely all of it but this has definitely helped me get a firmer grasp on what makes a good 3D character controller. Really insightful video.
@RoffeDH2 жыл бұрын
Hey, just created this Git repository with the assets I've created based on your tutorial. Just wanted to say thanks as this is EXACTLY what I was looking for.
@munyunu2 жыл бұрын
Ahhh whereeee is the repo please?
@alazuli22912 жыл бұрын
I just tried this method and it really works perfectly for me. Thank you.
@Sergeeeek Жыл бұрын
Thanks for your tutorials! I implemented a first person controller with this approach and it feels great, can walk over any terrain including other rigid bodies, even moving platforms! When landing a jump it crouches slightly due to the spring which feels realistic and satisfying. Got your game on Switch, looking forward to play it with friends this weekend :)
@patrickbateman464111 ай бұрын
im struggling to implement this for fps, could you give any pointers? ty
@Sergeeeek11 ай бұрын
@@patrickbateman4641 well I think this video explains it pretty well, what are you having issues with?
@Leonardorth.3 жыл бұрын
This is exactly what I've been looking for. Thanks for sharing !
@sabinudas53952 жыл бұрын
congratulations fam!!!
@CornRecords9723 жыл бұрын
This is very cool! Ironic that I found this because I've been building a similar physics based controller but for the opposite. Realistic physics based movement XD Best of luck on your game!
@sidneiguerrero12 жыл бұрын
What a legend only one ad in the beginning . Your so damn underrated
@milankiele23042 жыл бұрын
I fought so hard to get the best character controller... Your knowledge is the path to fulfillment
@ianainoaduarte3 жыл бұрын
Great video, great explanations. Saved me a whole lot of headache, but I'm still having problems with the whole applying torque part.
@mg16323 жыл бұрын
Very neat take on a CharacterController! Thank you for sharing - subscribed!
@7DragonEyes73 жыл бұрын
Really interesting. Release it on PC and I'll get myself a copy :)
@alicem34153 жыл бұрын
Thank you. I was having trouble figuring out how to make my Rigidbody controller more responsive. This has made it much better.
@matejzajacik84962 жыл бұрын
Wow, this is excellent! Straight to the point and very informative.
@tasdude3227 Жыл бұрын
YOOOOOO THANKS MAN EXACTLY WHAT I WANTED!! THANKS!!!
@CosmicComputer3 жыл бұрын
Oh my glob, this is freaking incredible, thank you for sharing this!!!!
@carlosmorais68702 жыл бұрын
I'm so confident, yeah, I'm unstoppable today
@Marcio_Queirozgx2 жыл бұрын
BROTHER, YOU ARE THE BEST!!! You oooh really helped me!! THANK YOU VERY MUCH!This is cool, well done!
@rohanvishayal87243 жыл бұрын
Amazing overview and good explanation, thank you looking forward to playing the game.
@torr.y Жыл бұрын
This is absolutely fantastic
@cookiefells_ofc2 жыл бұрын
Beautiful man, you're the only one who helped me
@outdoor19182 жыл бұрын
This was just awesome! Thanks a lot!
@seanisthedude2 жыл бұрын
Genuinely a fantastic and informative video. I ended up using some of the methods shown in my own game! I'm absolutely going to buy this game as a thanks (and also because the game looks great :P)
@ed_halley Жыл бұрын
I got pretty much all of the controller stuff working except the jump force working. Because the character's on a spring and could be moving up or down at the time of the jump, I guess I need to do the "neededAccel" calculation to achieve a consistent starting jump velocity. And then also support the jump-hold to bring it up to a maximum velocity.
@happyavocado71792 жыл бұрын
5 seconds before you said thats a bit boring I was like dude thats sick
@tapashsharma0892 жыл бұрын
You are doing a wonderful job by giving Knowledge many thanks
@AimlessGaming12 жыл бұрын
Damn bro top tier content, I'm sure you had to visit multiple countries to produce a masterpiece like this
@Usualyman3 жыл бұрын
This is epic! Floating character controller is pretty original decision! Never seen this before) Thanx!
@OverInfrared2 жыл бұрын
Making this work for VR was a bit weird, but worth it. Thank you.
@thoughtcipher9902 жыл бұрын
Hey guys, thanks for this video! I just completed our first full playthrough with my family. We all love this game, so thank you so much for your hardwork! 🙏 In this breakdown, you get goalvel by multiplying the normalized relative input vector by the maxspeed and speedfactor. Can you briefly explain what speedfactor is and why you need it? To everyone else reading this, if you haven't purchased this game yet, I encourage you to do so! Let's support game devs who do great work and care about their craft!
@Sandiles2 жыл бұрын
My guess is that speedFactor is just used so they can apply movement effects (slow down and speed up) based on game mechanics. So its not really important to the system as a whole.
@Loys-vo7cz2 жыл бұрын
OMG, it really worked. Thank you so much!!
@gonderage3 жыл бұрын
really not gonna lie, im gonna use this method of applying torque to remain upright. It's super fun to mess around with the spring strength and damper values to get wacky reactions! I can get some really wobbly bois that way. Thank you so much for the video!
@abentertainment7862 жыл бұрын
Thank you so much for all these tutorials bro. So much valuable knowledge
@AlexBlackfrost3 жыл бұрын
Wow, great video! Thanks for sharing!
@처링-p7i3 ай бұрын
thank you, this video really great!
@mrpotato8196 Жыл бұрын
Some things maybe a little over-complicated but considering this is a console game, everything had to be just right, console ppl are pretty strict I really liked how you made this (maybe you guys, this game and controller is way too good for one person) I also like making physics based systems since they basically handel everything themselves if you make it right, but everyone either mixes rb based movement with normal movement or just go with normal movement Earned a sub!
@Jyotigupta3992 жыл бұрын
You train so well! It's like you comprehend my tempo...
@margaritamoreno20762 жыл бұрын
Tysm, did everything as described
@ajajjssjdjdndns19172 жыл бұрын
Oh my god so good explained thank you!!!!
@pintadenis56412 жыл бұрын
That Guy Thanks, I will look into it later.
@Fghjkjhljhghj2 жыл бұрын
This was a great tutorial, thanks a lot!
@margaritamoreno20762 жыл бұрын
Cool You really help me Well done!
@benmendez77562 жыл бұрын
thank you straight to the point
@selfmades44942 жыл бұрын
So informative, thanks a lot!
@geri43673 жыл бұрын
Awesome, thanks for sharing :D
@CamoflaugeDinosaue3 жыл бұрын
Thanks so much for sharing, this is a very interesting approach! Would reeeeeally love to see your vehicle configuration! It looks like you're using Unity's vehicle/wheel physics, but it's more responsive and snappy than any controller using those Ive ever seen
@АртёмИванов-с4ы2ц2 жыл бұрын
This method works perfectly .. thanks for sharing ;)
@Carlos-dk2lt2 жыл бұрын
bro thanks so much. dis video is tiless 3 years ltr n still great
@ian_snyder3 жыл бұрын
This is amazing, sharing with my students :)
@hebashamaa76952 жыл бұрын
Very helpful, thank you
@apukumarsarkar70162 жыл бұрын
Thanks for the tutorial
@Ziboo303 жыл бұрын
This is gold ! thanks for sharing
@Zo.ro02 жыл бұрын
Thanks man! You nice tuto!!
@fiflax21882 жыл бұрын
Sounds perfect!!!
@petrussian82282 жыл бұрын
Thank you so much it was very helpful
@glx63772 жыл бұрын
It's working thanks my friend
@MaanaDev3 жыл бұрын
this is very cool! Ironic I'm looking from 2 days . but u missed active ragdoll to make it more cool and realistic it will be more interesting!
@xvdimmy8220 Жыл бұрын
This is gold!
@spikebor3 жыл бұрын
a very great system and carefully explained, thanks !
@Paul-to1nb2 жыл бұрын
Hi! Great video and blog! I was looking at the Character Animation blog post and I'm really confused about the "use an animation curve that defined how to move between single frame poses." I get the idea that you're blending between the poses, but I'm not sure how you can apply the animation curve to a pose.
@uicosole2 жыл бұрын
At 3:56 you say to "adjust it based on the camera angle" How can I do this? In your script it seems Rewired has some built in function, but I can't really figure out what it does, or how I would replicate it.
@uicosole2 жыл бұрын
if anyone gets the same issue as me, this worked for me: Vector2 moveInput = playerControls.Player.Move.ReadValue(); Quaternion lookQuaternion = Quaternion.Euler(0, cameraLookTransform.rotation.y, 0); m_UnitGoal = cameraLookTransform.rotation * new Vector3(moveInput.x, 0, moveInput.y); (the cameraLookTransform only rotates around its y axis)
@gunzalkar3 жыл бұрын
Great stuff very much helpful, Thanks!
@vishalsenapati38792 жыл бұрын
that was so use full! !
@tophitgames77523 жыл бұрын
Very well made video.. thanks for sharing this knowledge
@ElSonk3 жыл бұрын
Super excellent! Thanks a million
@KokapaGameDev3 жыл бұрын
thanks for sharing this is amazing
@denji67632 жыл бұрын
you explained. Thank you so much.
@camilatontis2 жыл бұрын
Cheers man!
@CarlosGonzalez-yo6ux2 жыл бұрын
Still helping after 2 years
@ethanjamesbarron20 күн бұрын
Hey hey I've been tinkering with this movement system for a while now and it's awesome! Unfortunately I've ran into an issue where going up or down slopes causes the movement to sort of sink or float above the desired height. Is this something you guys encountered? Was a fix ever found?
@LordHinson2 жыл бұрын
Amazing tutorial
@nolamo14963 жыл бұрын
awesome video! really helpful information!
@BooBeess2 жыл бұрын
damn the quality of video editing
@ruchirraj53002 жыл бұрын
Can you elaborate a bit more about how you calculate jumping force? It would help me a lot. Thanks
@ToyfulGames2 жыл бұрын
For jumping we just set the velocity directly when the jump starts, no need for a force at all.
@nthnnnnnnnnn3 жыл бұрын
Looks really cute
@calarey42502 жыл бұрын
It's so simple yet so complicated, it's perfect lmao