No video

Isometric Character Controller in Unity

  Рет қаралды 81,395

Tarodev

Tarodev

Күн бұрын

Пікірлер: 127
@Tarodev
@Tarodev 2 жыл бұрын
I have fixed a few things in this script, such as normalized diagonal movement and a few other bits and pieces. You can find it here: bit.ly/3BeDwB7
@themrfj
@themrfj 2 жыл бұрын
I added a comment to the script about responsive input :)
@PunCala
@PunCala 2 жыл бұрын
Correct me if I'm wrong, but if you put controls in FixedUpdate you run the risk of missing inputs as it is not called as often as Update.
@Tarodev
@Tarodev 2 жыл бұрын
@@PunCala I gather input in Update and move in FixedUpdate :)
@gargar_0
@gargar_0 Жыл бұрын
Thank you! This is the most intuitive tutorial I've ever seen! I love your style!
@Tarodev
@Tarodev Жыл бұрын
I'm glad you dig it 🙏🙏
@DissolvedMotions
@DissolvedMotions 2 жыл бұрын
Hey, can you make an tutorial about making a unity scene look nicer; lighting, materials, post processing etc. ?
@ramsey2155
@ramsey2155 2 жыл бұрын
actually, the relative variable is unnecessary because if you add transform.position to something and then remove it back nothing changes because it is like: a + b = (a + b) (a + b) - b = a
@gunbuckybucketman4578
@gunbuckybucketman4578 Жыл бұрын
Yeah, like could just use Input variable.
@tranvilap4713
@tranvilap4713 2 жыл бұрын
Great, simple, straightforward tutorial video as always.
@narkopraxis602
@narkopraxis602 2 жыл бұрын
I love this! Another great video Taro!
@samratrajsharma726
@samratrajsharma726 2 жыл бұрын
Can anyone help me to make the camera follow the character??
@Darkmwar
@Darkmwar 2 жыл бұрын
Where is the video he mentioned towards the end where the camera will follow a player ? Is there a video where you can move the camera in the same perspective ?
@Xeratas
@Xeratas Жыл бұрын
did you ever end up creating the "next video" you talk about in the video at the end? I didn't find it, would appreciate if you could link in case you created it :)
@ragerungames
@ragerungames 2 жыл бұрын
I like the jelly shaders on your cube
@Tharky
@Tharky 2 жыл бұрын
I'm binging all the good content, thanks for making such cool tutorials :)
@orifairyfire1931
@orifairyfire1931 2 жыл бұрын
I think you dropped this 👉👑
@Tarodev
@Tarodev 2 жыл бұрын
Thank you 🙏
@el_barracuda
@el_barracuda 2 жыл бұрын
Although I have been working with Unity for several years now and I have been doing everything myself, thanks to the author anyway for the content! In my time, this was not the case (
@pkplonker
@pkplonker Жыл бұрын
Found this whilst looking for a ISO camera setup. Just skip all of the matrix stuff and multiply the quaternion of the camera(that has the x/y rot) by the vector to give the same outcome. Note quaternion * vector, not the other way around :)
@Tarodev
@Tarodev Жыл бұрын
Interesting... That's elegant
@pdb0078
@pdb0078 Жыл бұрын
Really looking for the next video to learn the Camera Follow script... is it there, will it come?
@mufelo
@mufelo 2 жыл бұрын
is (transform.position + _input) - transform.position not just _input. and would you not want to instead normalize it (in general) altho not very important when using LookRotation. Not sure how the GetAxis behaves but wouldn't you also get a situation where you can move faster when your movement direction vector is something like (1,1) or is that already accounted for in GetAxisRaw?
@Tarodev
@Tarodev 2 жыл бұрын
Hah.. You're right on both accounts. Good eye. I'll go over the code tomorrow and fix it all up before posting the script in the description.
@mufelo
@mufelo 2 жыл бұрын
Np. Just wanted to check if I was missing something, especially since I havent worked with the axis controllers.
@Tarodev
@Tarodev 2 жыл бұрын
@@mufelo the difference between getaxis and raw is that getaxis has some smoothing built in... So even when on a keyboard, pressing w will transition smoothly from 0-1. Using raw allows you to make your own smoothing which will be reliable across keyboard and joystick.
@mufelo
@mufelo 2 жыл бұрын
Ahh I see, thanks!
@FullMetalAshley
@FullMetalAshley Жыл бұрын
This tutorial worked almost perfectly for me! I am having a lot of issues with the player collisions though. If I bump into another object with a collider attached, my player goes crazy. It'll bounce off the other colliders, and just start flying around like crazy. It also seems to be perpetually moving? I'm not sure why, this is a default project with a standard cube set on top of a plane with another cube in front of it.
@user.-795
@user.-795 Жыл бұрын
I have the same problem too
@tacitocaires5591
@tacitocaires5591 Жыл бұрын
Having this problem here too. Did some research, perhaps using rb.MovePosition is doing that. Didnt figure how to fix this... maybe another line of work to the movement.
@kdthx6043
@kdthx6043 2 жыл бұрын
Omg! It’s just what I was looking for Rn
@davidgarcia274
@davidgarcia274 2 жыл бұрын
You are the best man, thanks for all the tutorials!
@jessek3721
@jessek3721 Жыл бұрын
How would I strip the rotate out of this player controller so that it only responds to the directions without the tank movement? I'm trying to make a game where the character aims at the mouse but still moves on the isometric plane.
@harshaljadoncs5843
@harshaljadoncs5843 2 жыл бұрын
Awesome. I like to know more about matrix to use
@ZygimantasJurevicius
@ZygimantasJurevicius Жыл бұрын
We need same tutorial just with Character Controller! Awesome tutorial btw!
@martinrohwedder6618
@martinrohwedder6618 5 ай бұрын
Hello. Can you make a video on how to rotate the camera in a smooth 90 degree rotation on the y axis around the targeted player object on a key press please. Your videos are very informative and good.
@Snakebloke
@Snakebloke Жыл бұрын
Absolute legend! Thank you so much for your help in this, I've been a Python dev for a few years, but for some reason, this C# and Unity isn't clicking...
@Tarodev
@Tarodev Жыл бұрын
You'll get it brother. I bet it'll happen all of a sudden too, as you've been doing python.
@alexandres.vasconcelos8017
@alexandres.vasconcelos8017 2 жыл бұрын
Hey Tarodev, did you posted the video where the camera follows the player?
@bars5113
@bars5113 2 жыл бұрын
Thanks a lot for these tutorials! I appreciate it. I am trying to learn hyper-casual game development and I'm building prototypes for that area. If it's possible I would like to see a tutorial for a movement logic on runner type of games (like run of life or cube surfer from voodoo). Ive tried to move the player through rigidbody.moveposition with a constant force to the +z axis and according to the inputs I move the character through x axis, however, when player slides the screen too fast to the right or left character stucks on walls since there will be a huge force on x axis (by walls I mean the mathf.clamp in horizontal axis to stay on the platform). Parenting the player and moving the parent horizontal while moving the player forward didn't workout also, when I move the parent in horizontal axis player stops moving in z because of parents' movement effect. Moreover, didn't try out the paths that have turning points that would be another problem too. Maybe a tutorial about this could be helpful for people In my opinion. Thanks a lot again!
@Tarodev
@Tarodev 2 жыл бұрын
Good idea. I'll do a tutorial for this 😊
@pintalubaf
@pintalubaf 2 жыл бұрын
Super helpful! Thank you.
@sollner_fox
@sollner_fox 2 жыл бұрын
Very cool tut, but i have one question. Why u don`t use New Input System?
@Tarodev
@Tarodev 2 жыл бұрын
Too many people still use old input system, and until I do a video about the new input system to refer them to I will avoid it.
@sollner_fox
@sollner_fox 2 жыл бұрын
@@Tarodev );
@Tarodev
@Tarodev 2 жыл бұрын
@@sollner_fox (:
@ryancollins4243
@ryancollins4243 2 жыл бұрын
I highly recommend using something like Nvidia Broadcast, especially when using a mechanical keyboard, for reducing noise in the audio recording.
@Tarodev
@Tarodev 2 жыл бұрын
Do you know if Nvidia Broadcast cuts off the beginning/end of some sentences? I've found that a problem using some OBS filters. This is my fault as I ordered a loud keyboard for some reason -.-
@ryancollins4243
@ryancollins4243 2 жыл бұрын
@@Tarodev I have had no issues with a problem like that. Nvidia Broadcast right now is actually more so just a virtual audio interface, so it would be able to just feed right into whatever OBS you already use.
@Tarodev
@Tarodev 2 жыл бұрын
@@ryancollins4243 that's awesome. I'm going to download it right now
@EnterpriseKnight
@EnterpriseKnight 2 жыл бұрын
@@Tarodev ooorr you could lube the keyboard and turn your tutorials into asmr goodness.
@Tarodev
@Tarodev 2 жыл бұрын
@@EnterpriseKnight That's hot
@castlecodersltd
@castlecodersltd Жыл бұрын
Very good, thanks for sharing
@HansPeter-gx9ew
@HansPeter-gx9ew 9 ай бұрын
nice beginner video but I would wish more for taking the camera forward and up and project it into the main plane
@shahaf1312
@shahaf1312 2 жыл бұрын
Great tutorial. One thing that bothers me though is the fact that to the isometric nature of the scene (in 3D space), movement up and down seems slower than in the other directions.
@Kalahee
@Kalahee 2 жыл бұрын
In the case of 3D it is a perception (seems), but if you were doing 2D you would in fact ratio up and down input. Say your iso ratio is 2(h):1(v), you would halve vertical input (y axis). To push this further, imagine side-scrolling, but you were walking toward the camera. Since the camera is in orthographic (no perspective), there would be no perceptible movement toward camera at all even if your player is getting closer. Iso is a fake 3D perspective and its natural movement is in diagonal. One important detail to also note is your camera corners show further of your environment than sides or top/bottom, unless extreme ratio isometric.
@benfox9382
@benfox9382 2 жыл бұрын
this is a great tutorial!
@friedcrumpets
@friedcrumpets 2 жыл бұрын
This is great; thank you very much :)
@tehuster
@tehuster 2 жыл бұрын
You are a cool guy, you make great content, you know your shit and your funny. Subbed!
@osriocesar
@osriocesar 2 жыл бұрын
You got a like and a subscriber Thank you 🙏
@benfox9382
@benfox9382 2 жыл бұрын
Bit of a tangent Q - your renders, in both scene and game tab, look infinitely better than the bog standard ones my unity has on new project (I am new to unity as of yesterday). Do I need to tweak settings to get this higher quality that I see in yours? Talking particularly about the shadows and reflections on the gold cube. Thanks!
@Tarodev
@Tarodev 2 жыл бұрын
Look into reflection probes and metallic materials. That'll get you some of the way there. Look into lighting, post processing, ambient effects (dust for example). Finally look into shaders.
@benfox9382
@benfox9382 2 жыл бұрын
@@Tarodev Amazing, thank you! Have just completed a sandbox with lighting probes, and looking at reflection probes now. Legend! Subscribed!
@Ocov
@Ocov Жыл бұрын
Great video, did you ever get round to doing the camera follow script? I can find it in your videos.
@charlessnix7547
@charlessnix7547 Жыл бұрын
same question, it appears the answer is no?
@petercoakes4393
@petercoakes4393 2 жыл бұрын
Thank you very much for the tutorial, it was excellent! If I wanted to add a jump mechanic to this, what would the best way to do that be?
@re4727
@re4727 Жыл бұрын
Great vid. The one that shows the following camera was never made eventually?
@perdoist3627
@perdoist3627 8 ай бұрын
Nice video. But I have a question. When I tried to add mouse look pos it looks to mouse and moves toward mouse. How can I solve this problem ?
@Kapparow
@Kapparow 2 жыл бұрын
Nice vid!
@emregurses8782
@emregurses8782 9 ай бұрын
Thank you.
@eXca1iburN
@eXca1iburN 2 жыл бұрын
I'm not sure why monobehaviour was removed in the helper script, I'm not too sure what that is
@Tarodev
@Tarodev 2 жыл бұрын
Hey there! I have a video specifically covering what MonoBehaviour is, but in short: It's a unity class which is required if you wish to attach the script to a game object in the scene. It has logic to serialize values in the editor so you can adjust them, gives you direct access to the transform component so you can move, rotate and scale your object, and a bunch of help function to manage the object. That helper script does not need to be attached to any object and is just a container to hold some code, so I removed it 😊
@thegrey448
@thegrey448 2 жыл бұрын
really nice for this one. could you create animation tutorial for flying such as butterfly for 3d like rotate and flying smoothly. thanks in advance. mate.
@d.j.5950
@d.j.5950 9 ай бұрын
error in this line (; expected) public static Vector3 ToIso (this Vector3 input) => _isoMatrix.MultiplyPoint3x4(input);
@prietinho6690
@prietinho6690 2 жыл бұрын
is he using a gamepad? because with keyboard isn't working as the video for me, thanks! And with keyboard if u press at the same time diagonal keys it speeds up
@Tarodev
@Tarodev 2 жыл бұрын
I used both a gamepad and keyboard in this video. I've added the script in the description with fixed diagonal movement speed :)
@alidemorg
@alidemorg 7 ай бұрын
works awesome thanks!!
@aboziad100
@aboziad100 Жыл бұрын
Hi can you show the vedio that shows using WASD keys and mouse please? than you
@user-tu3gn6ym6v
@user-tu3gn6ym6v 10 ай бұрын
When I move on the X-axis I feel faster than the Y-axis, is that normal and should developers change that
@user-qh8yj3mb1w
@user-qh8yj3mb1w 9 ай бұрын
Thanks
@stylie473joker5
@stylie473joker5 2 жыл бұрын
Great video but i wish if you explained more of that matrix stuff
@alaslipknot
@alaslipknot 2 жыл бұрын
that (0,45,0) Vector3 is the camera rotation right ? does it mean that replacing that with any Camera rotation will give the correct result ? also does it work with Perspective cameras ?
@Tarodev
@Tarodev 2 жыл бұрын
Yes that's exactly what it means! Very flexible. Try it and see 😊 And yes, it does work with a perspective camera!
@thaihoangtruong4564
@thaihoangtruong4564 2 жыл бұрын
love it, thanks alots
@TankkOneFGC
@TankkOneFGC 10 ай бұрын
very good video. But the problem now is that if i simply construct the camera the follow the player, the isometric would be broken because it will rotating like the player. is anyone have an idea to construct the camera that will moove with the player without breaking the isometric view ?
@Tarodev
@Tarodev 10 ай бұрын
I released a video right after this showing isometric camera 😊
@Skittzy
@Skittzy Жыл бұрын
How would you go about creating sprites for this type of game? Isometric games are 3d but I want to use a pixel art style, or must i use a 3d model?
@_Irrelevant
@_Irrelevant Жыл бұрын
You can use a billboard in place of a 3d model. Have the billboard be connected to a sprite sheet, so that animations follow inputs. That's as far as I know, and I could be wrong.
@BIG0DEJOGANDO
@BIG0DEJOGANDO Жыл бұрын
I'm trying to develop an isometric roguelike, but I still don't understand how I can put character animations in this script. How was I this? Movement is simple: one animation to run, one to stand still, and a few to attack.
@diligencehumility6971
@diligencehumility6971 2 жыл бұрын
Very cool. I'd like to make an isometric game like this, but would like to make the assets in 2D/pixelart. How would you fit 2D pixelart into a 3D world like this, and still have it pixel perfect?
@aaryag5683
@aaryag5683 Жыл бұрын
you could either have 3d assets and have a pixel perfect shader or you could have 2d materials for the 3d objects
@andrewkapaldo5775
@andrewkapaldo5775 Жыл бұрын
Is this using the new player input system or using the old one?
@louisgjohnson
@louisgjohnson Жыл бұрын
@Tarodev is the next video ever coming?
@ABEHrEP
@ABEHrEP 2 жыл бұрын
Great tutorial, simple and straight to the point! One small thing tho, in your updated script that you've linked in the description you use "_input.normalized.magnitude" in Move function, but it doesn't seem to be working properly for me (Unity 2020.3.20f1), it stops being responsive to how hard you're pushing the stick, while the approach mentioned in the video "_input.magnitude" works properly.
@nickgutschow4504
@nickgutschow4504 Жыл бұрын
I know this is necro, but for other late readers in case it might be useful, this comment makes sense because normalized returns the directional component of a vector, i.e. the vector pointing in the same direction as the raw vector but with a length of 1, and .magnitude returns the length of the vector, but in this case .magnitude is being called on the already normalized version of the raw so would always return the scalar 1 because it is a referencing a unit vector, regardless of controller deflection. Agreed, nice tight tutorial.
@aknkekw
@aknkekw 2 жыл бұрын
Hey dude, thanks so much for the tutorial. I have one question and I'd appreciate if you'd answer it. Right now the character moves while rotating, how can I make it so it rotates in place and then move?
@saeta5733
@saeta5733 2 жыл бұрын
hey, have you figured out a solution to this yet? i had the same question and have been struggling with finding an answer.
@aknkekw
@aknkekw 2 жыл бұрын
@@saeta5733 Unfortunately not :(
@user-ne7ut3yx3x
@user-ne7ut3yx3x Жыл бұрын
I solved this problem. Like this transform.rotation = Quaternion.LookRotation(skewedInput, Vector3.up); //transform.rotation = Quaternion.RotateTowards(transform.rotation, rot, _rotSpeed * Time.deltaTime);
@aknkekw
@aknkekw Жыл бұрын
@@user-ne7ut3yx3x Thank you, if I every follow this tutorial again, I will try your solution :D
@manvendradeora1382
@manvendradeora1382 2 жыл бұрын
Hi you talk about isometric camera controller video at the end is it out yet?
@EugeneVilder
@EugeneVilder 2 жыл бұрын
I'm also wondering if it's out yet.
@d.j.5950
@d.j.5950 9 ай бұрын
please add touch movement control for mobile phone
@Kalahee
@Kalahee 2 жыл бұрын
Wouldn't it be easier to simply set your scene 45 degree off if you are to move in the same plane than your input anyway?
@Tarodev
@Tarodev 2 жыл бұрын
Sounds like a nightmare for level designers. can't use grid snapping any more and you'd need to rotate every asset
@joelkanna3563
@joelkanna3563 2 жыл бұрын
@@Tarodev Yeah...
@datablob
@datablob 2 жыл бұрын
isotastic 👌
@Tarodev
@Tarodev 2 жыл бұрын
Oh blobby
@gramaphenia
@gramaphenia Жыл бұрын
Hello, I have a question. I follow your tutorial and it works perfectly, thank you. But I have a problem. When I leave the platform I create, my character doesn't fall into the void and goes through the enemies. Will you know how I can fix that? Thanks a lot.
@wabschall
@wabschall Жыл бұрын
Sounds like you need to add a rigidbody component to your character,
@gramaphenia
@gramaphenia Жыл бұрын
@@wabschall Exactamente !!!! Muchas gracias!!! Saludos.
@KingFourth
@KingFourth Жыл бұрын
A year late, I know, but ToIso refuses to work for me? Just has the red squiggly underneath.
@Tarodev
@Tarodev Жыл бұрын
Tolso?
@KingFourth
@KingFourth Жыл бұрын
@@Tarodev I figured it out. Thank you though!!!
@eruditeminds4887
@eruditeminds4887 Жыл бұрын
How do you get that blue grid?
@jamesxxxyz8775
@jamesxxxyz8775 2 жыл бұрын
Acceleration/declaration.
@lamdo7897
@lamdo7897 2 жыл бұрын
smooth?
@yaboinachin7198
@yaboinachin7198 2 жыл бұрын
Is there any reason as to why you use vars? I think they're pretty lazy, you know the data type, use it. Dont give the processor the extra work of figuring out what it is.
@Tarodev
@Tarodev 2 жыл бұрын
Some people like var, some people don't. Meanwhile, I'll write 'var', while you sit there writing 'Dictionary'.
@yaboinachin7198
@yaboinachin7198 2 жыл бұрын
@@Tarodev imagine someone trying to figure out that that var is all of that? Its not intuitive at all in my opinion, but hey each to their own
@syedhasnadjami6008
@syedhasnadjami6008 2 жыл бұрын
var vs directly typing the type has zero performance benefit. As compiler still has to check the return type of a function to check if it is assignable to the declared variable type. So it is the same performance wise. It is just a matter of preference. When I first started using unity 4-5 years ago, I always typed the data type. Now I always type var as it increased my working rate. Also, rider always suggest to use var.
@emanueltejadacoste2250
@emanueltejadacoste2250 2 жыл бұрын
Does this work for 2D?
@testpig
@testpig Жыл бұрын
can you update all these videos to the new unity input system?
@flyingroads3498
@flyingroads3498 2 жыл бұрын
Hello. I was looking for 4 directions movement up down lef right isometric view bit with mouse rotation. Can you please update the project?
@Solo-iv8zy
@Solo-iv8zy Жыл бұрын
all I did is to rotate the floor by 45 degree.
@DevikenGames
@DevikenGames 2 жыл бұрын
thanks sir,i just liked this video but didn't watched yet as i'm planning to start working on all your videos from the first one,hope me best luck,also i would like to know if you are thinking about making some games copies making videos like this playlist kzfaq.info/get/bejne/qt9xqNeftNLXlnU.html
@masoncrowe
@masoncrowe Жыл бұрын
private void Look() { if (canMove) { if (movement != Vector3.zero) { // Get the camera's direction without the vertical component Vector3 camForward = Camera.main.transform.forward; camForward.y = 0; camForward.Normalize(); Vector3 camRight = Camera.main.transform.right; camRight.y = 0; camRight.Normalize(); // Convert the movement vector to be relative to the camera's orientation Vector3 relativeMovement = movement.x * camRight + movement.z * camForward; transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(relativeMovement), turnSpeed); } } } private void MovePlayer() { movement = new Vector3(move.x, 0f, move.y); // Adjust movement for the camera's orientation Transform camTransform = Camera.main.transform; // Get the camera's forward and right vectors on the ground plane (y = 0) Vector3 camForward = camTransform.forward; camForward.y = 0; camForward.Normalize(); Vector3 camRight = camTransform.right; camRight.y = 0; camRight.Normalize(); // Create a camera-relative movement vector Vector3 relativeMovement = move.x * camRight + move.y * camForward; relativeMovement.Normalize(); if (canMove) { if (!isDashing) { rb.AddForce(relativeMovement * speed * 10f, ForceMode.Force); } } }
Object Pooling in Unity 2021 is Dope AF
18:10
Tarodev
Рет қаралды 120 М.
How to Move Characters In Unity 3D | Character Controllers Explained
9:46
天使救了路飞!#天使#小丑#路飞#家庭
00:35
家庭搞笑日记
Рет қаралды 86 МЛН
Logo Matching Challenge with Alfredo Larin Family! 👍
00:36
BigSchool
Рет қаралды 21 МЛН
ROLLING DOWN
00:20
Natan por Aí
Рет қаралды 10 МЛН
Comfortable 🤣 #comedy #funny
00:34
Micky Makeover
Рет қаралды 17 МЛН
Pixel Art Class - Isometric Tile Basics!
25:55
AdamCYounis
Рет қаралды 350 М.
Why Isometric? | Art, Code and Matrix Maths | A Devlog
13:33
Wintermute Digital
Рет қаралды 202 М.
How Isometric Coordinates Work in 2D games
5:23
Jordan West
Рет қаралды 802 М.
Bringing My Cozy Isometric Game to Life | Hooked DEVLOG #2
22:10
Lost Game Dev
Рет қаралды 144 М.
10 Things You NEED to Be Doing in Unity
11:40
Tarodev
Рет қаралды 130 М.
Making an Isometric Tilemap in 2022
13:14
Lawless Games
Рет қаралды 49 М.
天使救了路飞!#天使#小丑#路飞#家庭
00:35
家庭搞笑日记
Рет қаралды 86 МЛН