Just to let everyone know, I'm currently revamping this series in 2020, and I already have the first episode out here: kzbin.info/www/bejne/hp6sgaR9ptVri7s. I strongly recommend following this instead since I've improved my methodology and included better visuals for beginners. Thanks!
@Jummmpy4 жыл бұрын
you did not include jumping in the revamp. is that in ep. 2?
@maxmodjeski81283 жыл бұрын
@@Jummmpy He hasn't made episode two yet, and its been months. I don't know if he's gonna even make it, so I just modified the movement script to have the jumping from this tutorial. Here's the code if you want it :) using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerController : MonoBehaviour { [SerializeField] Transform playerCamera = null; [SerializeField] float mouseSensitivity = 3.5f; [SerializeField] float walkSpeed = 3f; [SerializeField] float gravity = -13f; [SerializeField] [Range(0f, 0.5f)] float mouseSmoothTime = 0.03f; float cameraPitch = 0f; float velocityY = 0f; CharacterController controller = null; [SerializeField] bool lockCursor = true; private bool isJumping; [SerializeField] private AnimationCurve jumpFallOff; [SerializeField] private float jumpMultiplier; [SerializeField] private KeyCode jumpKey; Vector2 currentMouseDelta = Vector2.zero; Vector2 currentMouseDeltaVelocity = Vector2.zero; // Start is called before the first frame update void Start() { controller = GetComponent(); if (lockCursor) { Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; } } // Update is called once per frame void Update() { UpdateMouseLook(); UpdateMovement(); } void UpdateMouseLook() { Vector2 targetMouseDelta = new Vector2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y")); currentMouseDelta = Vector2.SmoothDamp(currentMouseDelta, targetMouseDelta, ref currentMouseDeltaVelocity, mouseSmoothTime); cameraPitch -= currentMouseDelta.y * mouseSensitivity; cameraPitch = Mathf.Clamp(cameraPitch, -90f, 90f); playerCamera.localEulerAngles = Vector3.right * cameraPitch; transform.Rotate(Vector3.up * currentMouseDelta.x * mouseSensitivity); } void UpdateMovement() { Vector2 inputDir = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical")); inputDir.Normalize(); if (controller.isGrounded) { velocityY = 0f; } velocityY += gravity * Time.deltaTime; Vector3 velocity = (transform.forward * inputDir.y + transform.right * inputDir.x) * walkSpeed + Vector3.up * velocityY; controller.Move(velocity * Time.deltaTime); JumpInput(); } void JumpInput() { if(Input.GetKeyDown(jumpKey) && !isJumping) { isJumping = true; StartCoroutine(JumpEvent()); } } IEnumerator JumpEvent() { controller.slopeLimit = 90f; float timeInAir = 0f; do { float jumpForce = jumpFallOff.Evaluate(timeInAir); controller.Move(Vector3.up * jumpForce * jumpMultiplier * Time.deltaTime); timeInAir += Time.deltaTime; yield return null; } while (!controller.isGrounded && controller.collisionFlags != CollisionFlags.Above); controller.slopeLimit = 45f; isJumping = false; } }
@Jummmpy3 жыл бұрын
@@maxmodjeski8128 thank you so much :D
@maxmodjeski81283 жыл бұрын
@@Jummmpy No problem!
@ethanviolet16 жыл бұрын
Finally a tutorial that doesn't teach you how to import standard assets! thanks
@joshuamason22275 жыл бұрын
exactly
@not_herobrine37525 жыл бұрын
it's broken as hell in unity 2018 and up
@TracerBH5 жыл бұрын
@@not_herobrine3752 why
@BreadcrumbMC5 жыл бұрын
@@not_herobrine3752 it is working for me!
@Lightologyy5 жыл бұрын
@@BreadcrumbMC Oh that's pretty cool! Congratulations and good luck in your project man :)
@AshTzu5 жыл бұрын
Great tutorial! Although may I add that in order to prevent the player from moving faster if moving on both the x and z axis you must first normalize the vector then multiply it by the movement speed variable: Vector3 forwardMovement = transform.forward * vertInput; Vector3 rightMovement = transform.right * horizInput; Vector3 moveDir = forwardMovement + rightMovement; moveDir.Normalize(); charController.SimpleMove(moveDir * movementSpeed);
@karpai54275 жыл бұрын
It makes movement not responsive for me. Player moves for a moment without pressing buttons.
@SubparFiddle5 жыл бұрын
Just leaving this for any aspiring designers, but normalizing your movement vectors isn't always the right thing to do. For example the recent fps DUSK allows you to bunnyhop and move diagonally to build up massive speed and is a ton of fun once you've mastered it. Most new players will never realize this and play the game the normal "intended" way, but by not capping speed the skill ceiling of movement tech is increased exponentially for those who want to play with it.
@narkroshi886 жыл бұрын
You sound like a young Snape with a head cold. Good tutorial btw!
@AcaciaDeveloper6 жыл бұрын
Oh gosh hahaha. You're the first person to make this joke in one of my newer videos. Glad this helped.
@thecomedyduo40014 жыл бұрын
this is literally the first tutorial that actually worked for me. Brackey's tutorial didn't work and it was super confusing, you actually explained it in a great and simple way. at least for me. thank you so much!!!!
@Migaligaz5 жыл бұрын
I think this is probably the best tutorial I have found so far. Subbed! Thanks!
@troy92175 жыл бұрын
As I learn to develop and make games, this channel has been a main support, thanks Matthew! Also, you posted this on my birthday!
@zombievirals6 жыл бұрын
Very useful! I was going to go with a pre-made FPS controller at first, but then I decided I would be better off doing something like this, and I'm really happy with the results! Thanks!!
@Avgunat0r6 жыл бұрын
This tutorial is outstanding in every way. Thank you & keep up the good work
@four-en-tee4 жыл бұрын
This is an amazing tutorial, and you did a great job both walking me through this while explaining what everything you're doing will do to the player character. Thank you.
@racmanov2 жыл бұрын
Many many thanks. I was doing Brackeys tutorial on this and i was hit with insane camera shutter. After many hours of solving and not accomplishing anything your tutorial worked wonders. No problem in editor or on build.
@b2eache25 жыл бұрын
Love your code, love the fast pace, no going over 6000 things that people at this point should know i.e. installing unity.. mad respect! looking forward to continue learning from you! this is kinda code I want! none of that makeshift shiz!
@bertramkorsholm50595 жыл бұрын
I love that u sound like squidward. Thats the best part
@NGarreau124 жыл бұрын
I thought it was more like a younger Snape
@TrikaArts5 жыл бұрын
thanks although im stil learning and i understood only 5% of what you re talking about but better than nothing
@katafalkistasaktyvuokwindo27395 жыл бұрын
Of course. That's how you learn :P
@Eradifyerao4 жыл бұрын
@@katafalkistasaktyvuokwindo2739 Assuming you go and tinker yourself... Otherwise what you have is a whole pile of frustration.
@countertube30714 жыл бұрын
@@katafalkistasaktyvuokwindo2739 nope he is just too fast. He write the complet script and close it if i have write 5 lines... Im try to make faster and make it faster... also the issues i make faster...and then i can look where this fcking failures are it... nice (learned my english with blueprints (2Jahrs) and Csgo... Cyka Blyad)
@Bcr31065 жыл бұрын
You know I actually prefer tutorials that go very fast like this. Pausing and repeating is much better than people that go way too slow. Thanks for this.
@petermoss73874 жыл бұрын
this series has a lot of helpful solutions to issues i was having with character controllers. thank
@Voidload5 жыл бұрын
actually really really well done, do not fear to put your passion emotions into the video if you feel like it. thanks also for explaining most of the stuff
@TheGios1005 жыл бұрын
That's so good. I came to a point where the unity standard FPcontroller was not giving me the results i needed.
@vishistsd5 жыл бұрын
You're awesome. You helped me get started with my project which I couldn't do myself for weeks
@frederickmcguy13525 жыл бұрын
Snape makes some good ass unity tutorials
@r.l.27085 жыл бұрын
Dude I was just thinking he sounds like Severus Snape
@evagagreel79744 жыл бұрын
absolutely the best tutorial on the whole internet!!!!!!!!!!!!!!
@WeegeepieYT6 жыл бұрын
Will you do a tutorial on Sprinting?! :)
@AcaciaDeveloper6 жыл бұрын
Planned for a future episode, so yes!
@WeegeepieYT6 жыл бұрын
Thanks uwu
@buddyroach6 жыл бұрын
public float walkSpeed = 10; public float runSpeed = 20; private float speed; void Start() { } void Update(){ if(Input.GetKey(KeyCode.LeftShift)) { speed = runSpeed; } else { speed = walkSpeed; } if (Input.GetKey (KeyCode.A)) { transform.Translate(Vector3.left * Time.deltaTime * speed, Space.Self); //LEFT } if (Input.GetKey (KeyCode.D)) { transform.Translate(Vector3.right * Time.deltaTime * speed, Space.Self); //RIGHT } if (Input.GetKey(KeyCode.W)) { transform.Translate(Vector3.forward * Time.deltaTime * speed, Space.Self); //FORWARD } if (Input.GetKey(KeyCode.S)) { transform.Translate(Vector3.back * Time.deltaTime * speed, Space.Self); //BACKWARD } } THIS CODE MAKES THE PLAYER AUTOMATICALLY ROTATE IN THE DIRECTION OF MOVEMENT. TO KEEP HIM FACING THE SAME WAY AT ALL TIMES, CHANGE THE " .Self " TO ".World"
@buddyroach6 жыл бұрын
same as my suggestion, except mine uses a public variable which can be changed in the inspector. i suppose you could make it a multiplier too instead of just a straight up value. and you could also put all the movement controls as public vars as well too. maybe later on when making a settings menu, with a controls sub menu, you can easily plug in the controller inputs from whatever the player chooses.
@buddyroach6 жыл бұрын
thanks
@playerqubo51583 жыл бұрын
THIS IS......Awesome, thank you a lot!!! I wanna create my own fps game!!! You received a new sub!
@MoTheBlackCat5 жыл бұрын
Thank you very much for this great video, I like the detailed explanations and the result seems quite solid even in 2019. Still need to adapt and test a lot more but great start for me!
@TheOnlyArtifex5 жыл бұрын
This is great! Lightweight character controller that's easy to understand and modify. I prefer this above the standard Unity character controller scripts that you can import. I especially think it's really elegant to use an animation curve as the jump force multiplier, I would've never come up with that. Thanks young Sna... Errr, Acacia!
@marino18055 жыл бұрын
Amazing video really helped me and the last fixes at the end were really nice.
@81Fredrick6 жыл бұрын
dude you rock, for real and the explaining while writing the code helps a lot I add comments with // thanks again
@S4ND1X5 жыл бұрын
This tutorial it's just awesome very well explained and very nice an clean code!
@imaginationgaming185 жыл бұрын
Finally Someone Pastes the code in the description
@andrupka87495 жыл бұрын
Yeah. I think same
@poobertop4 жыл бұрын
A little more complex, but the jump method is the best I've seen on youtube.
@jcstudios28095 жыл бұрын
thanks, helped a lot, I'm still learning this tutorial helped :)
@Maggiethegsd4 жыл бұрын
You could use Mathf.Clamp function to clamp that float between 90 and -90 angle
@ungordoenapuros5 жыл бұрын
Awesome, Acacia Developer! Easy, well explained and PRO "feeling" on using it! Thank you so much :)
@RebootedGaming6 жыл бұрын
Just a tip, use Input.GetAxisRaw for the mouse so it gets the raw mouse data. On top of that, don't multiply it by Time.deltaTime. For mouse input you shouldn't do that. Because in that case the mouse will only be smooth if you have a locked FPS, which you can of course set in the game engine though generally you don't want to lock the FPS in a game since other people might have a higher refresh rate.
@drowsy53846 жыл бұрын
Nice tips! Will apply in practice
@comradecheese35355 жыл бұрын
what are you multiplying it by then? considering this method won't work without Time.deltaTime
@jayit68515 жыл бұрын
If you don't multiply it by deltaTime the speed of the rotation will be frame rate dependent making faster computers have a faster rotation. That's the point of multiplying by deltaTime.
@storm50095 жыл бұрын
What should you input then?
@Cappuccino535 жыл бұрын
Locking FPS is good, because: 1. Update() runs once each frame, so if you have more frames per second script will be run more times, so if it is an Enemy NPC that is shooting if player is close enough, then it will shoot out more bullets, because that line of code will be true more times in a second 2. If you are playing on a 60 or 30 fps and it doesn't change, then it is ok and you might not notice anything, but if FPS is changing non-stop between 30-60, then player will not only notice that, but also it will get annoying, because sometimes character reacts quickly on your controls, when sometimes it takes a little bit more which can make player die quickly. You can also search on google why some games lock their fps
@Fezezen5 жыл бұрын
If you start falling off the edge of something and press space, you can still jump. To fix this you should initially check if the character is grounded before allowing a jump.
@antiRuka5 жыл бұрын
This is actually a feature.
@u.s70725 жыл бұрын
best Unity CC movement series to date
@JohnWeland5 жыл бұрын
Awesome tutorial, It would be neat to enable the camera (player look) to be used via controller, player movement is already setup as such
@rodjownsu4 жыл бұрын
Loved it, perfect pace for someone who has never used Unity, but is a C# developer, definitely not for new coders. Wonder why the Unity devs decided to go with regular method declaration rather than overriding the inhertied class method for 'start' 'update' etc.. Simpler for new users?
@babyfire62215 жыл бұрын
great video! this is a more advanced way to do the fpc and has teached me a lot thanks!
@Hiromu6566 жыл бұрын
Great job with this, can't wait to see more from you.
@matexpl92455 жыл бұрын
Thank you very much for this tutorial. Your script is perfect for Networking with PUN 2. 6 lines and done! Players moves and rotates individualy correctly. With the Rigidbody FPS character controller from the unity standard assets... it's not that simple.
@danielfoutz6 жыл бұрын
I appreciate how you explain things both clearly and quickly. So many KZbin tutorials take 2 minutes of introduction and then split each individual element into a separate video when the information could fit into a video around this size. Anyway, really excellent, I learned a lot.
@ДенисМаслов-т3х6 жыл бұрын
Ты очень умный человек, спасибо тебе )))
@AcaciaDeveloper6 жыл бұрын
Большое спасибо!
@ДенисАньенко5 жыл бұрын
@Sound Engineer Звукоинженер Я сделал так же, все работает. Проверяй скрипт.
@wafflebell4 жыл бұрын
@@FoverosInsanity lol
@RegenerationOfficial5 жыл бұрын
One of if not the best yet.
@ДимаЛьвович-ь8д5 жыл бұрын
3:45 You should NOT use Time.deltaTime here if you want it to be framerate independent, or it will do the opposite thing.
@RonanSmithUK4 жыл бұрын
As the camera is always a child of the player body you don't have to assign it every time if you just get the reference using: playerBody = transform.parent.gameObject.transform;
@aeriozz70476 жыл бұрын
please take it slow and take your time to explain how and why everything works instead of writing in super speed so i just get stressed out by it
@spazticjest6 жыл бұрын
You can adjust the speed of all youtube videos by clicking on the settings gear in the right corner. It has helped me a lot and I hope it helps you.
@tortomapachadas79805 жыл бұрын
@@spazticjest just go to the seetings, set the video speed to 0.5 and enjoy a Unity lesson by Severus Snape at normal speed
@novaplum16175 жыл бұрын
Notice how the op said " how and why", the "why" being an important part of the comment. Simply slowing the video down will not explain the " why" for the those seeking more in depth explanations; it just provides for them, what they consider to be, complicated concepts at a slower speed.
@TRGTheReviewGuys5 жыл бұрын
Sadly there are no further uploads after the 4th the channel seems abandoned, I still Subscribed though in case he comes back honestly the best tutorial I have found (No offence Brackey).
@user-yh9sz6eo9y5 жыл бұрын
Super useful and very well explained, thank you!
@jorgeMoreno-hk5gf5 жыл бұрын
hi! can you say me how can i move the player when is in the air? regards
@Belarus3605 жыл бұрын
How to make sure that when you press the left-right arrow, the camera does not move left-right, but rotates right or left around its axis?
@pottedplantarmy5 жыл бұрын
Your video thumbnail looks very professional.
@DapperNurd5 жыл бұрын
This is such a good video dude. You explain what you are doing with little slides, it's so much better than a normal tutorial video on youtube. I feel like I'm learning stuff here rather than just doing what they do on screen. My only complaint is that you maybe go a little too fast when actually typing the code.
@maltesvensen16356 жыл бұрын
thank you you have the best tutorial for fps controllers, you helped me so much.
@SubliminalJohn5 жыл бұрын
amazing the best teacher ever
@ArtisticallyGinger5 жыл бұрын
Why did you stop making videos? You do a fantastic job at showing how to build stuff.
@residentsicko2 жыл бұрын
Once writing the code for the jump and setting the animation curve the editor gives an error when played maximized but no error when played focused. Also now the camera movement seems jittery. For me anyway.
@awpinator76345 жыл бұрын
You need to slow down very hard to follow along when you're moving so quick. It even sounds like you're typing like a mad lad.
@crump20725 жыл бұрын
Hes just experienced, its obviously you who can't keep up. I mean look at the comments around you most are positive. Maybe you're just slow?
@SetharofEdgarDead-Rose5 жыл бұрын
Play Video, Watch Video, Pause Video, Write Code, Repeat!!!!!
@superjmm123453 жыл бұрын
he is going too slow for me, i need to see it at 2x speed XD
@JRHainsworth4 жыл бұрын
If I'm standing still under a low cieling and jump, the player sticks to the cieling for a moment before falling. This doesn't happen when I'm moving.
@zitrix78484 жыл бұрын
When i start the game in editor my player just flew up and i don’t knwo how to fix it but i can look in all the directions. please Help
@gamerbhaiyya_90ies5 жыл бұрын
thats what i was looking for ages ( i.e. since 2 days when i started to learn 3d gaming ;) thanks u so much ..!! one proper complete tuto
@inloaf64735 жыл бұрын
Hey i am running into error with unity where it doesnt let me use my script have you ran into this error to
@redline68026 жыл бұрын
Can you add make a tutorial on mid-air movement? I noticed that simple move returns if non-grounded and move in both coroutine and update doesn't work.
@zehsofficial5 жыл бұрын
Yeah I have the same issue with moving while jumping
@TheCrazyLunatic84 жыл бұрын
Whenever I press A or D, the engine seems to add both the vertical and the horizontal axes and the player just moves diagonally :/ I'm still learning and I just wanted to play around with the Unity engine, so, still don't know how to fix it.
@Ohmman4 жыл бұрын
would suggest rewatching the vid and paying close attention, and if that doesnt work go to the unity forums to see if theres something similar about it
@rredenvous5 жыл бұрын
This is the best tutorial ever , thank you very very much!!!
@problemchild9594 жыл бұрын
the only thing I don't like about this tutorial is you don't explain the conversion to the Euler Angles and hard lock it to a 90/-90. Honestly you should have used a variable and did a conversion so that people can change it. very few FPS games actually use 90 and -90 its more like -45 and about 70. very few people watching will have clue what to change the 270 and 90 to in order to adjust the clamping.
@Prolu75 жыл бұрын
Thank you Acacia! You were a big help!
@thegamer9b6035 жыл бұрын
Amazing tutorial, really helped me, thank you
@aresstavropoulos9165 жыл бұрын
great video, but I have one problem. Whenever I create a variable, specifically [SerializeField] private Transform playerBody; on time 9:45, it doesn't show up in the inspector under PlayerCamera. Any ideas?
@MoreNimrod4 жыл бұрын
Not sure why, but I was getting weird stuttering while playing around with this using Vulkan. Under DX11 it seems fine. I assume it's an API or Unity bug, or because the FPS is too high or some odd reason.
@aayushtyagi84193 жыл бұрын
Man, You are So Cool this is really helpful thanks:)
@therealmemernet6 жыл бұрын
I literally had to slow the video down to 0.25 because he is too fast for me
@mamad79766 жыл бұрын
0.75 sounds more natural
@therealmemernet6 жыл бұрын
True
@user-ms9yk5ug3e5 жыл бұрын
what do i do if i whant to control movement in air
@john_slickk22045 жыл бұрын
'isJumping' is not working in my Unity Version 2019.2.6f1 , what to do, and how can I implement it?
@johanhaggmark34995 жыл бұрын
Jumping wasn't working for me either. I couldn't find a place where "JumpInput();" were called. By putting the method call in PlayerMovement(), the character started jumping
@john_slickk22045 жыл бұрын
@@johanhaggmark3499 thanks man
@quopot40735 жыл бұрын
10:10 you said that -Transform.right has to be changed to Vector3.left preventing camera prom weird rotation, but even though I changed it camera is rotating as is shouldn't happend. I went to your git hub page and copied your script but same this happend....
@JustGaming465 жыл бұрын
Did you happen to find a fix, having the same problem...
@vaqquixx86206 жыл бұрын
I loved your other fps controller video but I couldn't figure out how to make it jump so thanks for this version
@endermanhunter4ugaming5695 жыл бұрын
it worked good untill i added the jump part whenever i start the scene my character gets sent to the fucking shadow realm
@Xinamottoo4 жыл бұрын
i did the same thing att the beginning but i can't look on Y axis at 5:05 where you could
13:23 whats the difference between using GetComponent and [SerializeField] when we can attach the component through inspector? i've always been taught to avoid using GetComponent or using it in the extreme situations, because a lot of GetComponents could have terribly impact on our game
@zehsofficial5 жыл бұрын
get component is useful when you want to access a script from a object prefab and edit that exact script for that object that can be cloned
@Spartan13314 жыл бұрын
Thank you, I learn a lot from this Video.
@Nangleator225 жыл бұрын
I missed the boat. The recent version of Unity doesn't have any character controller presets, nor scripts. It's impossible to follow this tutorial without those. My Empty asset isn't even a capsule, but an envelope in the scene list and invisible on the stage. The asset store seems to have only one free character controller package, but that's insanely complex, as if for a full game, and it's third person, when I want first person. I guess I'll try Unreal again.
@connorforman91435 жыл бұрын
the playerMove script makes the looking mechaninc all twitchy for some reason. It moves like dit-dit-dit-dit like it's low FPS. The movement isn't twitchy, just the looking.
@telecomanda5 жыл бұрын
When I save the script and go back to Unity, on the Camera game object, in the script component the Sensitivity, MouseX and MouseY doesn't show up! Please help me fix it!
@arvinkhoshboresh5 жыл бұрын
run the game once and then stop, it should come up.
@DJLKM15 жыл бұрын
Thanks for the tutorial, controller works great, only gripe is about your work flow speed, im getting fairly good at coding in C# but found it hard keeping up with what you were doing and why.
@Guyfrom20015 жыл бұрын
Thanks for the video, nice work👌
@lukeavery71745 жыл бұрын
i need some help when ever i input the following code it has red lines from Input to movementSpeed can someone see a problem? float horizInput = Input.GetAxis(horizontalInputName) * movementSpeed * Time.deltaTime; float vertInput = Input.GetAxis(verticalInputName) * movementSpeed * Time.deltaTime;
@rans0m_cs3 жыл бұрын
I know this is an older series, but I implemented this jump script with the newer movement script that you've posted and it works, but I find that my jump key doesn't register ever single time, but rather every 2 or 3 presses unless I get lucky and I can jump muliple times in a row without fail. Any idea what could be causing this bug?
@andersonmyguy50545 жыл бұрын
Thanks! Great video! I have one issue though, when my character jumps and hits a ceiling, he keeps floating instead of dropping straight down, he only goes down after the jump doesn't have anymore force, i dont know whats wrong. Please help
@jakobsharp84565 жыл бұрын
I just had the same issue. In the PlayerMove script between the lines "timeInAir~" and "yield return null" add: if ((charController.collisionFlags & CollisionFlags.Above) != 0) { break; } The while loop should be catching the collisions from above, but doesn't for some reason. My implementation probably isn't the best, but it seems to work.
@JoshGamingZone5 жыл бұрын
this help alot thanks for making this video:>
@markuswikstrom36905 жыл бұрын
Thanks for the video, it helped me a lot ^^
@w0tnessZA2 жыл бұрын
Awesome tutorial! Thank you!
@mikebely86635 жыл бұрын
what I have noticed, if I rotate 360 in one direction several times it finally blocks me from rotating that direction. Not sure what I could have missed, followed script exactly. Anyone else have this problem? Doesn't happen consistently though.
@Serz__5 жыл бұрын
UPDATE: I misunderstood how euler rotation worked, I changed the value passed in to ClampXAxisRotationToValue to equal 45.0, and now it clamps properly when I look down. So now i'm just passing in "-clampDown" to ClampXAxisRotationToValue, this is also working with looking up as you might expect. If I set the clamp for the camera looking down to anything other than directly down (-90) the camera freaks out. For example: I have it set to say this: clampDown is set to -45.0f here else if (xAxisClamp < clampDown) //Player looking down { xAxisClamp = clampDown; mouseY = 0.0f; ClampXAxisRotationToValue (clampDown + 180.0f); //Looking directly down is actually 90.0 in euler rotation } The value passed in to ClampXAxisRotationToValue will then be 135.0f I don't really see why that would bug it out, it works if I change the value of clampDown to -90.0f but anything else just breaks
@theholysalt185 жыл бұрын
Serz can I ask a question, about something
@vibe55565 жыл бұрын
console error '* cannot be applied to operands of type float and string. What to do tell me pls....
@sure56795 жыл бұрын
using string movementSpeed, instead of float?
@sure56795 жыл бұрын
i changed to float, i had mistakenly written string instead of float
@vibe55565 жыл бұрын
Ok, I got it.
@aw1lt4 жыл бұрын
it says that ‘Cursor’ does not contain a definition for ‘LockState’
@vinni_animates73812 жыл бұрын
well it still works in 2022
@varunshivaram7115 жыл бұрын
Superb tutorial very on point and helpful..... can you link the environment assets in the description so we can use while prototyping looks good
@죠타롱5 жыл бұрын
This tutorial really easy & usefull and powerfull to make 3D Games ever! thanks to awswome video!
@sure56795 жыл бұрын
Operator '*' cannot be applied to operands of type 'float' and 'string', on float horInput = Input.GetAxis(horizontalInputName) * movementSpeed;, it does not understand that Input.GetAxis does not return a string value :(
@sure56795 жыл бұрын
nevermind, i was using string movementSpeed, instead of float
@oharacare4 жыл бұрын
i have argument exception errors for both scripts saying no input axis