InGame Tilemap Editing - PART 2: Lines & Rectangles - 2D Level Editor with Unity - Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ธ.ค. 2024

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

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

    Awesome, thank you!
    So happy with how this series is coming along 🙂

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

      That's great to hear, glad you like it ;)

  • @vitalysushilov5802
    @vitalysushilov5802 8 หลายเดือนก่อน

    Brilliant work. Thank you.

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

    Another useful video as always.

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

    Slight problem I found while testing:
    If you right click to unselect while drawing a line or rectangle it will instantly draw when you make a new selection. This is easily fixed by adding "holdActive=false;" and "previewMap.ClearAllTiles();" to the SelectedObj setter.
    Otherwise, great video!

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

    10:55 the Line95 In my case it only work as "if (ctx.interaction is SlowTapInteraction)" was it a mistake or i messed up something?

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

    This really helped! Thanks! :D

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

    How to deal with rectangles, pentagrams, solid circles, and hollow circles with only borders?

  • @ManjeetKumar-xk8jf
    @ManjeetKumar-xk8jf 3 ปีที่แล้ว +3

    Great tutorial can we see your face on your next tutorial?

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

      Haha, maybe. It requires more preparation

    • @ManjeetKumar-xk8jf
      @ManjeetKumar-xk8jf 3 ปีที่แล้ว +1

      @@VelvaryGames what's your job?

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

      I work as a software developer

    • @ManjeetKumar-xk8jf
      @ManjeetKumar-xk8jf 3 ปีที่แล้ว +1

      @@VelvaryGames Wow, i work as a game developer. How you started developing games?

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

      @@ManjeetKumar-xk8jf Sorry for the late response. It's cool that you work as a game developer. I'm a software dev who enjoys playing games, so it just happened one day that I tried game development, but it's just a hobby for me.

  • @kushs-labs
    @kushs-labs 2 ปีที่แล้ว +2

    Hi. Thanks for the video. It helped me navigate myself through the mechanism. However I had some issues and don't know if it is specific to my project but this helped me solve it.
    instead of the one in the video use this:
    _dragRectangleBounds.xMin = Mathf.Min(_currentGridPosition.x,_holdStartGridPosition.x);
    _dragRectangleBounds.xMax = Mathf.Max(_currentGridPosition.x,_holdStartGridPosition.x);
    _dragRectangleBounds.yMin = Mathf.Min(_currentGridPosition.y,_holdStartGridPosition.y);
    _dragRectangleBounds.yMax = Mathf.Max(_currentGridPosition.y,_holdStartGridPosition.y);

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

      Oh this is definitely a great way to get those values. Thanks for pointing it out :)

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

    Thank you so much for the tutorial. The IsPointerOverGameObject() now throws a warning that calling the event system in an event callback only gives information from last frame. I fixed with RaycastAll. Code below:
    List raycastResult = new List();
    PointerEventData pointer = new PointerEventData(EventSystem.current);
    pointer.position = playerInput.Gameplay.MousePosition.ReadValue();
    EventSystem.current.RaycastAll(pointer, raycastResult);
    // Old UI check: !EventSystem.current.IsPointerOverGameObject())
    if (SelectedObj != null && (raycastResult.Count == 0))
    This is in BuildingCreator.csm, in OnMouseLeftClick().

    • @jaimeandres5000
      @jaimeandres5000 6 หลายเดือนก่อน

      If anyone else faces this and you want to maintain similar logic you would just need to set it as a field variable in the update method and reference that instead in your cose
      private void Update()
      {
      isPosOverGameObject = EventSystem.current.IsPointerOverGameObject();
      .....
      }