I'm really happy I stumbled across your channel. I never really used character controllers before and this series is very clear and concise so I appreciate your content and thank you for making it. I was going to ask a question but fortunately I figured out my rookie mistake so I'll just share my problem and solution incase someone else has the same issue. If you're making something like a twin stick shooter and find that using a joystick, your aim is inaccurate/snaps to 8 directions, the code is not the issue. To make your aim more accurate, just open your Input Action Asset and click whatever binding you have set as your "Look" composite (this would be the "Move" composite if you followed part 1 and haven't added any other bindings). Change the "Mode" from "Digital Normalized" to "Analog" and save the asset. It may seem silly but I spent a good hour debugging before I figured out that my issue was the input being normalized and not the code doing something I didn't understand.
1:45 I've followed through with typing out the code that you've presented, alongside following the rest of the tutorial up to this point, but when I try to playtest said code, I end up with three complier errors, what causes this? In specific, it says I don't/have misplaced a semicolon and a "}" and that I don't have an identified.
Thanks for doing this series! The character no longer snaps to a direction after letting go of the keys, but it is still snapping to the 8 directions rather than being fluid. Not sure if that is supposed to happen, or if I messed up somewhere.
I suppose you're not still stuck on this issue, but in case anyone else gets this problem (like I did), the fix for me was to set the smooth time in the editor to 0.05 in . Somehow it didn't follow from my script into the editor automatically.
Hello ! I've used your code, and even copied/pasted yours to make sure I disn't miswrite something, but when I play the scene and move my character around, it always has a "floating moment", like even when I release a key the player still moves for around half a second. Do you know what could cause such a thing ? Anyway thank you for your videos, they're helping a lot :D
I don't understand how one is supposed to figure out these problems. Like, how would you know to make an if statement for the _input square magnitude in order to solve the snap forward feature? when hovering over the line, it literally only says "returns the squared length of the vector" lol. as if I can just understand that by itself.
I had this working earlier but when I've come back to it, my rotation isn't working at all. Its as if it can only read one direction at a time. Any idea why I can't rotate while moving?
Hi, I doubt you will see this message but I have got all of this code exactly the same as yours yet it says c1519 invalid token '=' in class, record, struct or interface member declaration, i cannot find anything for this one since i have the exact line by line code from you, Please help
I put in var targetAngle:float = Mathf.Atan2(y:_directon.x, x:_direction.z) * Mathf.Rad2Deg; transform.rotation = Quaternion.Euler(x:0.0f, y:targetAngle, z:0.0f); and it say identifier expected what does that mean
I’m guessing the confusion lies in my editor. This is what the code for targetAngle should look like: var targetAngle = Mathf.Atan2(_direction.x, _direction.z) * Mathf.Rad2Deg; The types are just visual indicators to tell me what value the method expects. :)
I'm really happy I stumbled across your channel. I never really used character controllers before and this series is very clear and concise so I appreciate your content and thank you for making it.
I was going to ask a question but fortunately I figured out my rookie mistake so I'll just share my problem and solution incase someone else has the same issue.
If you're making something like a twin stick shooter and find that using a joystick, your aim is inaccurate/snaps to 8 directions, the code is not the issue. To make your aim more accurate, just open your Input Action Asset and click whatever binding you have set as your "Look" composite (this would be the "Move" composite if you followed part 1 and haven't added any other bindings). Change the "Mode" from "Digital Normalized" to "Analog" and save the asset.
It may seem silly but I spent a good hour debugging before I figured out that my issue was the input being normalized and not the code doing something I didn't understand.
Enjoying these videos. Really well explained
Thank you for these perfekt tutorials.
Your lessons help me a lot to learn Unity. Thank you very much )
Thanks for the guides :) Just what I've been looking for
Glad to hear that! Thank you! 🤗
Really useful to me.
I am so impressed.
Very glad to hear that, thank you! 🤗
@@chonkgames thank very much :)
You're genious⚡
straight to the point, easy to follow and very helpful. ez sub
Thanks, much appreciated! 🤗
Thanks for your video, with subtittles, you're the best 👍
thanks man this was perfect! math ftw
Thank you 🙂
incredible tutorial!
Thank you, glad you liked it! 🤗
@@chonkgames thanks a lot again. you explained it very understandable and clearly.
very good.
Thanks, glad to hear that! 🤗
Thanks 👍
Ty
1:45 I've followed through with typing out the code that you've presented, alongside following the rest of the tutorial up to this point, but when I try to playtest said code, I end up with three complier errors, what causes this?
In specific, it says I don't/have misplaced a semicolon and a "}" and that I don't have an identified.
wait it's cool i just thought the "float:" part of the code was messing with everything
great
Thanks for doing this series! The character no longer snaps to a direction after letting go of the keys, but it is still snapping to the 8 directions rather than being fluid. Not sure if that is supposed to happen, or if I messed up somewhere.
I have exactly the same problem. Did you find a fix for this?
3:00
I suppose you're not still stuck on this issue, but in case anyone else gets this problem (like I did), the fix for me was to set the smooth time in the editor to 0.05 in . Somehow it didn't follow from my script into the editor automatically.
Hello ! I've used your code, and even copied/pasted yours to make sure I disn't miswrite something, but when I play the scene and move my character around, it always has a "floating moment", like even when I release a key the player still moves for around half a second. Do you know what could cause such a thing ?
Anyway thank you for your videos, they're helping a lot :D
Nevermind I found my answer, the problem was that I accidentally added a rigidbody component to my character !
I don't understand how one is supposed to figure out these problems. Like, how would you know to make an if statement for the _input square magnitude in order to solve the snap forward feature? when hovering over the line, it literally only says "returns the squared length of the vector" lol. as if I can just understand that by itself.
how would that last part work if you're using the new input system?
I had this working earlier but when I've come back to it, my rotation isn't working at all. Its as if it can only read one direction at a time. Any idea why I can't rotate while moving?
How would I go about applying animations to a character using this code? I am using an actual mesh and animations I made rather than a capsule.
Hi,
I doubt you will see this message but I have got all of this code exactly the same as yours yet it says c1519 invalid token '=' in class, record, struct or interface member declaration, i cannot find anything for this one since i have the exact line by line code from you,
Please help
I put in var targetAngle:float = Mathf.Atan2(y:_directon.x, x:_direction.z) * Mathf.Rad2Deg;
transform.rotation = Quaternion.Euler(x:0.0f, y:targetAngle, z:0.0f); and it say identifier expected what does that mean
I’m guessing the confusion lies in my editor. This is what the code for targetAngle should look like:
var targetAngle = Mathf.Atan2(_direction.x, _direction.z) * Mathf.Rad2Deg;
The types are just visual indicators to tell me what value the method expects. :)
Hi, how to move forward relative to rotation?
This is so complicated, I dont understand everything. But i started Game Development 1 week ago, to be fair.
Let me know if I can help you in any way, and good luck! You’ll do just fine! 🤗