How To Rotate Tiles with Code in Godot

Поделиться
HTML-код
  • Опубликовано: 11 май 2024
  • In this video I will explain how to rotate tilemap tiles in Godot using code.
    The editor has buttons that allow you to rotate and mirror tiles when creating a tilemap, but this is more difficult when you need to modify your tilemap in the game at run time.
    This video gives the code that I used to achieve this in my automation game.

Комментарии • 11

  • @woodenfences
    @woodenfences 28 дней назад +2

    Well done the coding logic, and well done the video about it. Thanks for sharing!

  • @user-zx3mk3wl6e
    @user-zx3mk3wl6e 28 дней назад +3

    Good job ❤
    More godot content please

  • @tf5pZ9H5vcAdBp
    @tf5pZ9H5vcAdBp 27 дней назад +1

    Weird way to figure out I'm a mother, getting a mother's day gift from coding with Russ.

  • @PrueferAuge
    @PrueferAuge 2 часа назад

    how can i rotate a tile by a custom amount, in the editor? im using hexagons, and rotating 90° isnt exxactly helpful

  • @scorpi0uk
    @scorpi0uk 27 дней назад +1

    Great video and good to know these possible nuances but is it not possible to just rotate the tile "normally" by 90, 180, 270 degrees? (Probably using the deg_to_rad method) and then having rhat data saved so its remembered?
    Maybe theres some other logic im missing like the sprite being rotated but not the direction that items move? Just spitballing here

    • @CodingWithRuss
      @CodingWithRuss  27 дней назад +1

      I expected there would be a way to rotate the tiles like you described but I couldn't find anything in godot that would do that. An individual sprite2D could be rotated easily enough but that didn't seem to be the case for a tilemap tile since there just isn't a method for rotating tiles with code.
      Hopefully it is something that gets simplified in future versions of godot.

  • @rezashir3873
    @rezashir3873 26 дней назад +1

    Well done

  • @shafiullahptm909
    @shafiullahptm909 18 дней назад

    sir sir pls tell me why the buttonmodule is not downloading using pip sir pls tell me sir i have less time pls pls sir a humble request from me