Mouse Click Movement in Isometric Tilemap - Unity Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ก.ย. 2024
  • Isometric Mouse Movement in Unity Tutorial using the NEW input system.
    ᐅGet the full Source Code Bundle to my Unity Tutorials 🤓
    sam-yam.itch.i...
    📥 Get the Source Code 📥
    / isometric-mouse-38744509
    🔗 Relevant Video Links 🔗
    ᐅMaking an Isometric Tilemap with Elevations and Colliders in UNITY
    • Making an Isometric Ti...
    🤝 Support Me 🤝
    Patreon: / samyg
    Donate: ko-fi.com/samyam
    Disclosure: This post may contain affiliate links, which means we may receive a commission if you click a link and purchase something that we have recommended. While clicking these links won't cost you any money, they will help me fund my development projects while recommending great assets!
    😎 Cool Unity Assets 😎
    ᐅPeek - Editor Toolkit: assetstore.uni...
    ᐅEditor Console Pro: assetstore.uni...
    ᐅRainbow Folders 2: assetstore.uni...
    💖💖THANK YOU TO ALL MY PATRONS 💖💖
    ❯❯❯ My Links ❮❮❮
    💗 Patreon 💗
    / samyg
    💬 Discord Server 💬
    / discord
    🐦 Twitter 🐦
    / samyam_utube
    📚 Facebook 📚
    / samyam.youtube
    🎵 Music 🎵
    Fretless by Kevin MacLeod
    Link: incompetech.fi...
    License: creativecommons...
    👍 Like and Subscribe! 👍
    🖥️ Computer Setup 🖥️
    *As an Amazon Associate I earn from qualifying purchases.
    www.amazon.com...
    #unity3d #unitytutorial #unity2021

ความคิดเห็น • 141

  • @huehuehuehuehuehuehue
    @huehuehuehuehuehuehue 4 ปีที่แล้ว +6

    I learned a lot from this video, more than some official guides! Thank you, keep up the great tutorials showcasing the code working.

  • @turkeyjerkey
    @turkeyjerkey 3 ปีที่แล้ว +6

    Great job! Have you considered extending this tutorial to include showing the movement range for the player by highlighting tiles in the Tilemap (e.g., for a turn-based game)? Thanks for all your excellent tutorials!

    • @samyam
      @samyam  3 ปีที่แล้ว +2

      Thanks! That's a great idea, I hadn't thought about it. I would like to make some more isometric videos in the future, I'll keep it in mind, thanks!

  • @DurboxX
    @DurboxX 4 ปีที่แล้ว +15

    Please keep doing isometric tutorials. There is almost no content about isometric and im super interested. I want things like how to do NPCs or battle events? whatever you can teach!!
    Thanks in advance and keep up the good work!
    Also I have tried your tutorial but it appear as error that says "variable map has not been assigned". You said on the video that we have to reference it in the editor but how and where is that ? xD I started unity like yesterday and don't know even the most basic things.

    • @samyam
      @samyam  4 ปีที่แล้ว

      In the inspector you have to assign your tilemap to the Game Object which you attached the script. You can drag and drop your map there.
      I'll keep in mind the suggestion for future videos. Glad you enjoyed!

  • @marcoramosgrajeda8398
    @marcoramosgrajeda8398 3 ปีที่แล้ว +1

    Amazing, you have no idea how much your input tutorials have helped me, I was felling so overwhelmed, but now I'm using it in my new projects, thanks a lot and keep it up you are amazing :D

    • @samyam
      @samyam  3 ปีที่แล้ว +1

      Awesome!! Thank you!

  • @KaneOnYoutube
    @KaneOnYoutube 3 ปีที่แล้ว +3

    You nailed this! Love the tutorial- can't wait to expand on the basic concepts and (hopefully) make something truly impressive!

  • @НикитаМарибор
    @НикитаМарибор 4 ปีที่แล้ว +1

    Thanks for using the new input system. So little video about it.

    • @samyam
      @samyam  4 ปีที่แล้ว

      Thanks for watching!

  • @jonathanjblair
    @jonathanjblair 4 ปีที่แล้ว

    I honestly don't know why you don't have more views and subs. You cover interesting topics and explain what you are doing extremely well. Only thing you should watch is the number of times you say "and then" (I have the same issue with saying So next we). In any case, don't get discouraged, you are making fantastic content. People will find it.

    • @samyam
      @samyam  4 ปีที่แล้ว

      Thank you so much! I'll definitely keep that in mind 👍

  • @lucianbodnaresku6568
    @lucianbodnaresku6568 2 ปีที่แล้ว

    This video Is really usefull, It resolved all my problems thank you so much keep going!!

  • @Dexter-rx3xg
    @Dexter-rx3xg 2 ปีที่แล้ว

    Waaaw my first time see a vry vry clear tutorial. Thank you sso mach 👍🏼

  • @Kakashi42069
    @Kakashi42069 3 ปีที่แล้ว

    You are so good at explaining everything, this is literally gold

    • @samyam
      @samyam  3 ปีที่แล้ว

      Thank you so much! :)

    • @Kakashi42069
      @Kakashi42069 3 ปีที่แล้ว

      @@samyam Question, when it comes to making new games, how do you normally prioritize the workload/what would you break apart as like step 1 -> step 2 -> etc? Say you had to do everything by yourself

    • @samyam
      @samyam  3 ปีที่แล้ว

      Well first it’s always good to make a game design doc to plan your game and know what you need to implement before hand, then you can use a tool like codecs or trello and prioritize the features based on importance. You can also use sprints like in software engineering to manage the timing of the features. And before delving into the full game sometimes it’s useful to make a prototype to make sure the game is actually enjoyable and makes sense.

    • @Kakashi42069
      @Kakashi42069 3 ปีที่แล้ว

      @@samyam Thanks; would you say most of the game design is from the coding on fuctionality or creating the assets/graphics? (or equal in time/development, or something else completely?)

    • @samyam
      @samyam  3 ปีที่แล้ว

      Game design is a mixture of the whole game in its entirety, you can have great mechanics but most people won’t play a game if the graphics are horrible or don’t make sense with the plot or mechanics. It’s a mixture of everything and taking it into account. I’m actually reading a book called Designing Games which is pretty good and explains the process on how experience game devs approach game design (still haven’t gotten there in the book).

  • @richardw2977
    @richardw2977 4 ปีที่แล้ว

    It's been several years since I've worked with Unity. This was helpful in a number of ways. Awesome tutorial. Thank you for sharing your insight.

  • @MoonLiteNite
    @MoonLiteNite 4 ปีที่แล้ว

    Awesome, another video with the new input system!

  • @zhongmanzhang1925
    @zhongmanzhang1925 4 ปีที่แล้ว

    Like your Tutorial! Concise but informative! Thank you!

  • @UnofficialFoneE
    @UnofficialFoneE 2 ปีที่แล้ว

    I could be wrong, but to stop the shaking you should set the position of your character using the rigidbody.position property and not the transform.position. What is likley happening is you are setting the position of the player inside/into a collider and then the rigidbody is seeing its inside the collider and then moving character back. This likely causes the shaking and should stop if you instead us the Rigidbody2D component.

  • @darkeinhardt3760
    @darkeinhardt3760 3 ปีที่แล้ว +1

    thx again to help so much

  • @janpaweii3115
    @janpaweii3115 2 ปีที่แล้ว

    thats awesome and you are really skilled. some more isometric, maybe physics in isometric 2d.

  • @dand6929
    @dand6929 2 ปีที่แล้ว

    hey, thank you so much for your videos, you got a new sub here :) your videos are really helping me!

    • @samyam
      @samyam  2 ปีที่แล้ว

      Thank you! Glad they help :)

  • @jaicarey7023
    @jaicarey7023 3 ปีที่แล้ว

    This tutorial is awesome, thank you very much!
    Really happy with this new system from Unity, I remember having to do all of this mouse position and clicks manually, so much cleaner!
    Thank you!

  • @yomerrallo1
    @yomerrallo1 2 ปีที่แล้ว +1

    I might be a bit late for this but... What would need to change to have the player anchored (in movement) to the middle of each tile? So that the movement acts like FF tactics for example.

    • @samyam
      @samyam  2 ปีที่แล้ว +1

      This function may help :)
      docs.unity3d.com/ScriptReference/Tilemaps.Tilemap.GetCellCenterWorld.html

  • @astronuggie
    @astronuggie 3 ปีที่แล้ว +1

    I know this old but I'm so desperate. I implemented this and it works great, but I'm trying to figure out how to animate my character's sprite in 4 directions as they move. Could you make something like that PLEEEEASE??

    • @samyam
      @samyam  3 ปีที่แล้ว

      I don’t currently have a video on it but this video covers it pretty well and the project download link is in the description
      th-cam.com/video/tywt9tOubEY/w-d-xo.html

  • @PrinceArtanis
    @PrinceArtanis 3 ปีที่แล้ว +2

    Need the next iso tut please samyam. how to walk only on tiles and not anywhere? how to pathfinding then? please continue

    • @samyam
      @samyam  3 ปีที่แล้ว

      You can have different layers for walkable tiles and check if you can walk on it before moving. I'll add more isometric tutorials to my list for future videos!

    • @PrinceArtanis
      @PrinceArtanis 3 ปีที่แล้ว

      @@samyam tyyy

  • @MonoJaviX
    @MonoJaviX 2 ปีที่แล้ว +3

    Hi Sam, excellent tutorial, I followed the previous one where you showed how to do the tilemap and this one for the movement, but when I hit the play button in Unity, my capsule doesn't move and I get no errors. I was trying to debug it but I can't find a way to do so. I checked the code and the steps in the video many times and all seems to be exactly the same, how can I find out why is not working? is there a way to check if my mouse click is being captured and what position is being sent to the script? Thank you very much for your time making this video!

    • @Kakashi42069
      @Kakashi42069 ปีที่แล้ว

      Idk if you figured it out but I had a similar problem. My fix was you have to make sure your Z axis on the tilemap is 0 for transform position and Main Camera to -1 for Z axis for transform position with the cylinder also on 0 for Z axis.

  • @BanyoPK
    @BanyoPK 3 ปีที่แล้ว

    I'm doing the same thing, but got by ScreenToWorldPoint and couldn't catch the mousePosition, will pause the video, continue doing it by myself and wen finish go back to compare.
    Great tutorial :D

    • @samyam
      @samyam  3 ปีที่แล้ว +1

      Thanks! For screen to world point make sure your game plane is at 0 z position, and that the mouse position you are passing into the function has the camera near plane distance to the plane for the z axis. In this case you can pass in the camera near plane distance to the function as it does here in the example:
      docs.unity3d.com/ScriptReference/Camera.ScreenToWorldPoint.html

  • @JackyTran
    @JackyTran 3 ปีที่แล้ว

    Another awesome straightforward tutorial! Thank you!

  • @marinatedbadger3939
    @marinatedbadger3939 3 ปีที่แล้ว +1

    me just tryna get some new inspiration for a game
    mr beast and honey be like "no no no get distracted lol"

  • @weepees6013
    @weepees6013 10 หลายเดือนก่อน

    Wow :( When my unity reset I lost everything from my scene that I was working on from the last video.....
    and it made me do it over again, and I did it faster and better than the first time. However now I'm stuck again. I can't get my character to move at all. I feel like I've followed all instructions to a T and it's not working.

  • @adamkarolin
    @adamkarolin 4 ปีที่แล้ว +2

    Thanks for great tutorial. I had one problem with mouse position, when ScreenToWorldPoint(mousePosition) I get all time camera position. After when I change mousePosition as Vector3 and set z axis of camera coordinates that's solved my problem. I have no clue why my script works different.

    • @samyam
      @samyam  4 ปีที่แล้ว +2

      In the docs they specify to provide the depth as the z for the screen to world position function. It has to do with how your camera is aligned (orthographic vs perspective)
      answers.unity.com/questions/599097/need-help-understanding-screentoworldpoint.html

  • @daialencar7176
    @daialencar7176 4 ปีที่แล้ว

    Great content, keep the job

  • @horazcing
    @horazcing 4 ปีที่แล้ว +1

    Thank you so much for this tutorial!

  • @mihaistanciu2487
    @mihaistanciu2487 3 ปีที่แล้ว +1

    Hi there! Really nice video. Can you give us some direction on how to implement NavMeshAgent for that, please?

    • @samyam
      @samyam  3 ปีที่แล้ว +1

      There’s no built in way for 2D nav mesh, you’ll have to use a package of make your own. NavMeshPlus is a good package here:
      github.com/h8man/NavMeshPlus

  • @boggo3848
    @boggo3848 2 ปีที่แล้ว

    Thanks a lot for your great video. I have all of this working but annoyingly (as in your video) the sorting between the character and the tilemap pieces, especially when you go behind a tile doesn't work correctly and I've just scoured the internet for a solution with no success.

    • @WildPork
      @WildPork ปีที่แล้ว

      It's hard to tell what your problem is, but I think for the Collision layer, she instructed to changed the Y offset of the Tilemap Collider 2D to 0.5. This pushes the collider above the tile, so when you go behind it, you hit it when you shouldn't. Just reset it back to zero so it actually covers the tile.

  • @xaleu
    @xaleu 3 ปีที่แล้ว +1

    thanks for the tutorial, it helped, if anyone is wondering how to move to the exact grid cell you clicked in the center like I needed to you can use GetCellCenterWorld from the map like this, destination = map.GetCellCenterWorld(gridPosition); Im new to unity and it took me a while to figure it out as I found no mention of this on several places I looked

    • @yomerrallo1
      @yomerrallo1 2 ปีที่แล้ว +1

      This helped a lot actually. Thank you.

  • @jesseharrington828
    @jesseharrington828 4 ปีที่แล้ว

    This was really helpful! I'm just starting with unity and I recently made a tilemap with lots of elevations. I'm wondering if you have a video on how to make the character jump to a higher elevation or possibly climb.

    • @samyam
      @samyam  4 ปีที่แล้ว +1

      I personally don't have a video on that but Unity has a video which might help: th-cam.com/video/544zgvKnbKc/w-d-xo.html
      It involves making a collider tilemap for elevations. They have the project assets in their description as well.

    • @jesseharrington828
      @jesseharrington828 4 ปีที่แล้ว

      samyam thank you so much! That’s really helpful

  • @hantingqin6065
    @hantingqin6065 2 ปีที่แล้ว

    Hi, I am getting this error when trying to use your code:
    InvalidOperationException while executing 'performed' callbacks of 'Mouse/MouseClick[/Mouse/rightButton]'
    Is there any chance you'd know why this is happening?

  • @francescoconcari1544
    @francescoconcari1544 2 ปีที่แล้ว

    Greta video! Is there a way to round the input.mouseposition values, in pederz to center the player in the grid?

    • @samyam
      @samyam  2 ปีที่แล้ว

      Thanks! There is GetCellCenterWorld function that you can use docs.unity3d.com/ScriptReference/Tilemaps.Tilemap.GetCellCenterWorld.html

  • @PandaNuker
    @PandaNuker 3 ปีที่แล้ว

    Really really awesome! Watching in 2021. Thanks a lot !
    Question: I get a non-blocking error when I run the script, NullReferenceException: Object reference not set to an instance of an object. Any idea why? I'm new here

    • @samyam
      @samyam  3 ปีที่แล้ว +1

      If you double click the error it will take you to the line where the error is. That means you are trying to access something that doesn't exist, or you forgot to set a variable/reference somewhere in your code.

  • @daSenfgurke
    @daSenfgurke 3 ปีที่แล้ว

    Is there something predefined to make the character move along the tilemap? Meaning some pathfinding for the 2D space of the ground tiles?

    • @samyam
      @samyam  3 ปีที่แล้ว

      There is yet no built in way, but there are some github packages you could use.
      Here’s a forum that could help:
      forum.unity.com/threads/navmesh-and-tilemaps-pathfinding.609445/

  • @sanoopmenon6032
    @sanoopmenon6032 3 ปีที่แล้ว

    This was really helpful.
    Is there a way toh get position of isometric z as y on click?
    I was unable to get position of elevated tiles.

    • @samyam
      @samyam  3 ปีที่แล้ว

      Hi seems like you need to add an offset, here is a thread that might help (answer is at bottom)
      forum.unity.com/threads/clicking-on-tiles-with-an-isometric-z-as-y-tilemap.660238/

  • @Mystical-TEDDY_
    @Mystical-TEDDY_ 3 ปีที่แล้ว

    But what about like just keyboard movement for 4 or 8 directions

    • @samyam
      @samyam  3 ปีที่แล้ว

      I have a video for grid movement, it's not isometric but it should work similarly
      th-cam.com/video/YnwOoxtgZQI/w-d-xo.html

  • @LucasAlfare
    @LucasAlfare 4 ปีที่แล้ว

    Very good! Also, Do you have any video showing how to properly setup VS Code to Unity?

    • @samyam
      @samyam  4 ปีที่แล้ว +1

      This is the video I used th-cam.com/video/_v9mc3dcwYE/w-d-xo.html

  • @ParanoYa1117
    @ParanoYa1117 3 ปีที่แล้ว

    I have used this tutorial to create a isometric game with wasd as the control scheme. I have a problem with the tile colliders. It actually takes the outer most edge of the tile texture for the collision shape. Though on the grass blocks it actually should only be the grass. Now my character can move on the cobblestone beneath the grass blocks which looks weird. I'm not sure whether I've the wrong physics settings or something like that. I would appreciate any help!

    • @samyam
      @samyam  3 ปีที่แล้ว

      th-cam.com/video/2DsKCJsEzSA/w-d-xo.html at 3:25 I believe is the setting you want where you can select your own collider type, however I don't fully understand the question without seeing it, if you'd like we have a Discord channel where you can post in the help channel what's happening discord.gg/SwCKB3Q

  • @andidroid6465
    @andidroid6465 3 ปีที่แล้ว +3

    thank you you are really good. You are the next Brackeys :)

  • @SaSeshen
    @SaSeshen 3 ปีที่แล้ว

    I typed everything line by line that you did but my variables never actuated which prevented the code from executing as expected. What am I doing wrong or differently? I also happen to have a different version of Unity, so should I simply update the version of unity I am working on or is something else? for instance when we created the private Vector3 destination; destination never turned light blue at any point in the script.

    • @samyam
      @samyam  3 ปีที่แล้ว

      I have a Godot theme enabled in VS Code which which is why some of my colors may be different than yours. Make sure you have intellisense working which helps the code editor recognize the code words. Also make sure to look at your console for any errors in your script.
      I have a video on setting up vs code here if that helps th-cam.com/video/4WWX2_tZu5Q/w-d-xo.html

  • @makc3682
    @makc3682 4 ปีที่แล้ว

    Hello! Thanks for the videos. I dont understand how i can do mobile joystick with animation of character in Isometric tilemap using the new input system. Where l can lern about it?

    • @samyam
      @samyam  4 ปีที่แล้ว

      Mobile Joystick with NEW Input System th-cam.com/video/YV5KOZHsIz4/w-d-xo.html
      Animator Controller th-cam.com/video/1Ll1fy2EehU/w-d-xo.html
      Animator Controller Scripting th-cam.com/video/3Ad1wr3qBRw/w-d-xo.html
      Instead of moving in 3D just move in a 2d space (x and y).

  • @joaolourenco5499
    @joaolourenco5499 ปีที่แล้ว

    How come you are not using a Player Input component and still works!? 🙈

    • @samyam
      @samyam  ปีที่แล้ว

      The PlayerInput component is a wrapper, you don’t need it to use the Input System

  • @aikou2886
    @aikou2886 3 ปีที่แล้ว

    Somehow this looks easier than the input system.

    • @samyam
      @samyam  3 ปีที่แล้ว

      It does use the input system though! 👍

    • @aikou2886
      @aikou2886 3 ปีที่แล้ว

      @@samyam I meant the other input system video (the one that uses directional keys), sorry.

  • @lm7586
    @lm7586 3 ปีที่แล้ว

    What's the reasoning behind using the new input system? Is it better than the old one?

    • @samyam
      @samyam  3 ปีที่แล้ว

      It’s easier to adapt and customize, for example you can create different control schemes and have the same code work for any control scheme, great for cross compatibility. If you need to change a control you don’t need to dig much through the code, you can just change your input asset.

  • @sir.poopiehead3601
    @sir.poopiehead3601 3 ปีที่แล้ว +1

    That was quite helpful, danke!

  • @gfversusbf
    @gfversusbf 3 ปีที่แล้ว

    Thanks for this tutorial, new to Unity and this is a good tutorial! However, followed both videos to the latter and for some reason the tilemap seems to be dropping out of the sky! The player then cant move correctly, any advice? Cant seem to figure it out! Thanks

    • @samyam
      @samyam  3 ปีที่แล้ว

      Make sure to make the rigidbody static or disable it’s gravity + freeze position and rotation 🙂 Since it’s a physics object it’ll drop with gravity if you don’t disable it

    • @gfversusbf
      @gfversusbf 3 ปีที่แล้ว

      @@samyam literally worked that out a minute before seeing this comment! Thanks for the tutorial it was great!

  • @letsplaynay9936
    @letsplaynay9936 4 ปีที่แล้ว

    How do I change the character costume depending on the direction they are facing

    • @samyam
      @samyam  4 ปีที่แล้ว +1

      You can get the direction from the input and depending on the direction you set the Animator component to a different value. Here is a video that might help: th-cam.com/video/tywt9tOubEY/w-d-xo.html
      They also have the project available for download in the description and they have a function that converts direction to an animation index

  • @huyenbhoang
    @huyenbhoang 3 ปีที่แล้ว

    Hi, thanks for the tutorial! I have a question. I created 3 copies of the character, and when I click to move to a destination, the 3 copies merge into one dot stacked on top of each other when they arrive at the destination. How do I prevent this? I'd like them to have some resemblance of spacing between each other. Thanks!

    • @samyam
      @samyam  3 ปีที่แล้ว

      Kind of hacky but you can put the copies as children to the main game object with an offset so that it'll move with the main character. Or you can calculate that offset manually depending on which copy they are.

    • @huyenbhoang
      @huyenbhoang 3 ปีที่แล้ว

      @@samyam ahh. I keep thinking if I added a collider to each of them they would not overlap. I’ll try to figure out your two hacks :)

  • @jesseharrington828
    @jesseharrington828 4 ปีที่แล้ว

    Hello, is I have my character moving and bumping into things but the colliders are a little bit janky. Specifically the character can walk on the sides of my isometric tiles and I want it to only be able to walk on top. Is there a fix for this?

    • @samyam
      @samyam  4 ปีที่แล้ว

      You could remove the destination if it hits a collider (oncollisionenter) stopping the jankiness. What do you mean by walking on the sides of the tiles; do you want the character to jump over? Maybe this might help for that th-cam.com/video/544zgvKnbKc/w-d-xo.html

    • @jesseharrington828
      @jesseharrington828 4 ปีที่แล้ว

      samyam basically it’s walking on bottom part of the isometric tiles. It’s a grass block, so it starts to walk onto the dirt part on the sides which I don’t want

    • @samyam
      @samyam  4 ปีที่แล้ว

      You can adjust the grid properties to shift it over making sure it's only on the grass, make sure your tiles are the correct aspect ratio. The video I sent you previously also might help

  • @referol5118
    @referol5118 3 ปีที่แล้ว

    Hi, I'm from Russia, why do I have a map selection and Movement Speed ​​in my Inspector

    • @samyam
      @samyam  3 ปีที่แล้ว

      If you made the variable public or private w/ SerializeField they will appear in the inspector

  • @JVDBERGHE
    @JVDBERGHE 3 ปีที่แล้ว

    Your videos are really helpful and are very clear.
    I am however having a problem with the "mousePosition = Camera.main.ScreenToWorldPoint(mousePosition);" part
    I am receiving this error message:
    "NullReferenceException: Object reference not set to an instance of an object
    TargetAimer.Update () (at Assets/Scripts/TargetAimer.cs:33)"
    I have tried to fix it by making a refrence to a camera but when I hit play it unasigns the camera somehow
    Is there any advice you would be able to give me to solve this error?

    • @samyam
      @samyam  3 ปีที่แล้ว

      Make sure your camera is tagged as Main in the inspector, also you should keep a reference to avoid making a lot of Camera.main calls

    • @JVDBERGHE
      @JVDBERGHE 3 ปีที่แล้ว

      @@samyam Thank you for replying.
      The error message is now gone but my mousePosition is now always the value of the center of the screen
      What can I do about this?

    • @samyam
      @samyam  3 ปีที่แล้ว +1

      Probably because you should pass into the function the distance from the camera near plane to the object you want to cast against. I usually set the camera near plane next to the 2d scene (or right on it as long as it doesn’t cut off) and pass in cameraMain.nearClipPlane for the zed axis in the vector3 that i’m passing in
      docs.unity3d.com/ScriptReference/Camera.ScreenToWorldPoint.html
      Here you’ll see the function takes a vector3

    • @JVDBERGHE
      @JVDBERGHE 3 ปีที่แล้ว

      @@samyam It took me a little while until I completely understood but I managed to solve it.
      Thank you very much for your aid.
      The way you respond to people who need help is very usefull, keep up the great work!

    • @samyam
      @samyam  3 ปีที่แล้ว

      Nice glad I could help! 😄

  • @crijogos
    @crijogos 4 ปีที่แล้ว

    Hello, teaches you how to create a movement similar to minecraft dungeons, where he follows the mouse and rises 1 square in height, thanks

    • @samyam
      @samyam  4 ปีที่แล้ว

      Hi I'm a bit confused are you requesting a tutorial or just saying what the tutorial is about?

    • @crijogos
      @crijogos 4 ปีที่แล้ว

      @@samyam Sorry, I'm not very good at English.
      Could you do a tutorial on the isometric movement like minecraft dungeons, where he can follow the click of the mouse and climb 1 square in height?

    • @samyam
      @samyam  4 ปีที่แล้ว

      Minecraft isn't isometric but you can easily make the player move through elevations just by changing their position to go on top of the elevation through a passable area. Heres a great link for more information blogs.unity3d.com/2019/03/18/isometric-2d-environments-with-tilemap/

  • @veindesigns
    @veindesigns 3 ปีที่แล้ว

    Great videos, Does this work with Isometric Z as Y?

    • @samyam
      @samyam  3 ปีที่แล้ว +1

      Thanks! I haven't tested it with Isometric Z and Y, however it seems the recommended function for that is grid.WorldToCell instead of map.WorldToCell
      answers.unity.com/questions/1622564/selecting-a-tile-with-z-as-y-isometric-tilemaps.html
      forum.unity.com/threads/clicking-on-tiles-with-an-isometric-z-as-y-tilemap.660238/

    • @veindesigns
      @veindesigns 3 ปีที่แล้ว

      @@samyam OMG You are a legend! You don't know how many web pages i've looked at in the last 24hrs and didn't come across these :S - Guess I need to start searching Unity's forums specifically! Thanks for the quick reply!

    • @samyam
      @samyam  3 ปีที่แล้ว

      No worries! Unity forums and answers are where it’s at!!
      Also, I just searched unity isometric z as y click in google and those were some of the top searches.

  •  3 ปีที่แล้ว

    I did everything but my character don't move when I click :s

    • @samyam
      @samyam  3 ปีที่แล้ว

      Maybe you can try setting a breakpoint to see what is getting called. Also, remember to enable your controls in the OnEnable() function.

    •  3 ปีที่แล้ว

      @@samyam When I move the Character manually changing the X Y values in play mode, it moves again back to the starting point

    • @samyam
      @samyam  3 ปีที่แล้ว

      @ Hmm, make sure you aren't overriding any values somewhere.
      You can also join our discord and post in the #help channel with your code or more detailed explanation of your issue so we can help better :)

  • @nirvanna21
    @nirvanna21 4 ปีที่แล้ว

    Is there any way to make it snap to the grid after movement has taken place?

    • @samyam
      @samyam  4 ปีที่แล้ว +2

      You can calculate where the center of the current tile should be and move it there docs.unity3d.com/ScriptReference/Tilemaps.Tilemap.GetCellCenterWorld.html

    • @nirvanna21
      @nirvanna21 4 ปีที่แล้ว

      @@samyam Thanks a lot, it's a very informative video btw!

  • @mikethegamedev
    @mikethegamedev 4 ปีที่แล้ว

    Nice!!!!!!!!!!!!!!!!

  • @wonderwaffle7343
    @wonderwaffle7343 4 ปีที่แล้ว

    Hey its me BlueWolf. Long time no see lol

    • @samyam
      @samyam  4 ปีที่แล้ว

      Hope you've been well!

  • @flexmachine2280
    @flexmachine2280 4 ปีที่แล้ว

    Respect!
    Привет из России))

  • @SteveBlues87
    @SteveBlues87 3 ปีที่แล้ว

    But how do you get the sprite to move on the isometric path? Nobody seems to know how to do this as every isometric tilemap video I've watched, the sprite just moves diagonally and not isometrically.

    • @samyam
      @samyam  3 ปีที่แล้ว

      It would be similar to grid movement which I have a video for.
      And just make sure you are moving in the correct direction in relation to the size of the cell. For example to move sideways with a cell size of (1,.5) you’d need to move .5 left or right on the x axis to get to the center of the next cell and etc.
      Let me know if that helps.
      th-cam.com/video/YnwOoxtgZQI/w-d-xo.html

  • @CarbonTaxLOL
    @CarbonTaxLOL ปีที่แล้ว

    my object doesnt appear in the camera even though it appears in the scene, I have no error messages in the code. The right click doesn't work?
    Wish I could just send files across, anyway nice tutorial. Not sure why my shit ain't working.

  • @Ivcifer
    @Ivcifer 3 ปีที่แล้ว

    you're amazing!

  • @marcelruetters
    @marcelruetters 3 ปีที่แล้ว

    oh man, i would love learn to use unity, but i am so scared of learn programming

    • @samyam
      @samyam  3 ปีที่แล้ว

      It's not too bad! I have a beginner series here
      Unity Beginner Mini-Series
      th-cam.com/play/PLKUARkaoYQT178f_Y3wcSIFiViW8vixL4.html
      Where you don't need to know programming, but it will help.
      Unity also has their own scripting course for free on their website
      learn.unity.com/project/beginner-gameplay-scripting

  • @MuriloMielke
    @MuriloMielke 4 ปีที่แล้ว

    Does the 'character' has to be a 3d object to this to work? It's a weird concept to put it as 3d since the game is 2d, lol

    • @samyam
      @samyam  4 ปีที่แล้ว

      Not at all, I just added a capsule to show how to movement works

  • @kevincallanan3126
    @kevincallanan3126 3 ปีที่แล้ว

    So your previous video was fantastic on creating an isometric tilemap but this tutorial 23 seconds in there is already a problem.. searching for "input system" in the package manager gives me a nice big list of NOTHING. And please if someone says to look in the asset store for it then also include which one as there's a MASSSSSIVE list to choose from

    • @samyam
      @samyam  3 ปีที่แล้ว

      Hm, Did you select the Unity Registry at the top? That will show the list of packages Unity provides
      docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/Installation.html

    • @kevincallanan3126
      @kevincallanan3126 3 ปีที่แล้ว

      @@samyam >< Don't I feel like an idiot now it was set to show my assets probably something I changed at some point and didn't even know or forgot about. Guess after today I will never make this mistake again as they say live and learn.... Thank you

    • @samyam
      @samyam  3 ปีที่แล้ว

      No worries 😂

  • @bortbreadface6259
    @bortbreadface6259 ปีที่แล้ว

    hehehehe.... tooty.

  • @Channel4NewsIsGay
    @Channel4NewsIsGay ปีที่แล้ว

    The autogenerated script MouseInput.cs is giving me this error "error CS0102: The type 'MouseInput' already contains a definition for 'MouseActions'" :S