Character Rotation | Simple Character Controller in Unity | Part 3

preview_player
Показать описание
Here's the third part of the Simple Character Controller series, and today we will be making our character rotate and face the direction we're moving in!

Let me know if you have any questions or requests, and I'll try my best to help you!

This series is mainly aimed towards beginners wanting to learn how the New Input System works.

#unity3d #unitytutorial #inputsystem
Рекомендации по теме
Комментарии
Автор

Thank you for these perfekt tutorials.

alma
Автор

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.

Tysard
Автор

Enjoying these videos. Really well explained

straylight
Автор

Your lessons help me a lot to learn Unity. Thank you very much )

tigerjustice
Автор

Thanks for the guides :) Just what I've been looking for

mysh
Автор

Really useful to me.
I am so impressed.

wermisapalma
Автор

Thanks for your video, with subtittles, you're the best 👍

FlorentinDUBOIS-nf
Автор

straight to the point, easy to follow and very helpful. ez sub

cachau
Автор

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.

VeryTori
Автор

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.

gravecastleofficial
Автор

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

dubosemeline
Автор

how would that last part work if you're using the new input system?

petitcoke
Автор

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.

jankystreams
Автор

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?

Delvarn
Автор

Hi, how to move forward relative to rotation?

mj-nlfc
Автор

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

chanelwilson
Автор

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.

toadieboi
Автор

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

swagtrapswag
Автор

This is so complicated, I dont understand everything. But i started Game Development 1 week ago, to be fair.

Minir