How to make Doom-style directional sprites in Godot

Поділитися
Вставка
  • Опубліковано 21 сер 2024
  • Got tired of waiting for 3.1 to come out so here's a new tutorial. This is for you Stefan Randa
    sprites: imgur.com/a/5W...
    imp script: pastebin.com/N...
    camera script: pastebin.com/g...
  • Ігри

КОМЕНТАРІ • 50

  • @CutMeSomeSlackTheVII
    @CutMeSomeSlackTheVII Рік тому +16

    I will kiss your heart alhamdullilah this works FLAWLESSLY 4 YEARS LATER ON GODOT 4

    • @levioptionallastname6749
      @levioptionallastname6749 5 місяців тому

      how so I am having a problem with it skipping to frame 0 constantly? am i missing something?

  • @BrannoDev
    @BrannoDev 4 роки тому +25

    I really do enjoy these intermediate level tutorials. Just straight to the point with enough explanation to understand why things work.

  • @chef2654
    @chef2654 5 років тому +24

    You an absolute beast, thank you so much for the tutorial :)

  • @Ferkiwi
    @Ferkiwi Рік тому +2

    Great video! I was going crazy with vector math to try to figure out how to properly get the character direction to reflect at the same time as the relative camera position.
    I'm doing things slightly different, using a BlendSpace2D, but your video helped me figure out the right values, thank you!
    Short, easy to follow, and very useful.

  • @alex2mine111
    @alex2mine111 5 місяців тому

    Filled out multiple pages of a notebook trying to do this myself. This was so much better then what I was trying to (unsuccesfully) make!

  • @onelios
    @onelios 2 роки тому +1

    I have been days stuck with this problem and your video fixed it in a moment. Thank you very much!!

  • @MoKaLu
    @MoKaLu 5 років тому +1

    now you've gotten me sea sick! thank you for the tutorial.

  • @gingercore69
    @gingercore69 4 роки тому +2

    THIS is what i needed... Thank you very much... i subscribed

  • @DanniloSN
    @DanniloSN 5 років тому +1

    I love your tutorials.

  • @hinekde
    @hinekde 4 роки тому

    Thanks for the tutorial, short and precise as always :)
    Near to the end I thought, why isn't he just using frame_coords, but than I saw, that Godot didn't have frame_coords on the Sprite3D back then.

  • @woodsmith3124
    @woodsmith3124 2 роки тому +6

    The rotation works, but the sprite doesn't go through its walk cycle. I'm assuming something changed between versions, but I'm not sure what.

  • @noobmaster-ez4nx
    @noobmaster-ez4nx 5 років тому +3

    Epic

  • @ron0studios
    @ron0studios 4 роки тому

    Yay I think the godot Devs saw this! They have billboard nodes now!

  • @boymeetsdrake6438
    @boymeetsdrake6438 2 роки тому +1

    oh shit gotta say your videos are great been needing to do this for my 3d game which just uses sprites, probably going to make the trees and shit with picard to make it very close to real 3d. but honestly i could come up with some good trees and rocks with just this actaully considering picard is so weird and hasnt worked for me so far i think i will. jajajajajajajaa again nice video

  • @M_tch311
    @M_tch311 4 роки тому +2

    Hi! Great video, really helped me understand a lot as a new comer to Godot. I tried to implement this into a game im working on, but i have a problem with the imp facing the correct position of a moving player. I added a script to move the enemy towards the player, however if I happen to strafe the enemy the animation doesnt face the player. I tried to implement it as a child of a kinematic body so i could set a rotation speed and for the movement script as well. Any help would be appreciated.

  • @stabbedbyapanda
    @stabbedbyapanda 2 місяці тому

    Spatial Node = Node3D

  • @DarkShroom
    @DarkShroom 3 роки тому

    nice one thanks for the solution
    i'm trying to sort of write a helper for doing the animations with the decorate style animation frames... this saves me the stressful bit

  • @allisongross2946
    @allisongross2946 4 роки тому +2

    My characters are asymmetrical! Time to do more work :')

  • @archery171093
    @archery171093 5 років тому +2

    Hello sir, I really like your video and started a new project to test your stuff and it's very cool !
    I have a question : how is it possible to handle the fact that the front sprite (for example) switch to the front-left one when we are aligned with the forward vector but not looking directly toward it ? (you face the imp, you are aligned with the forward vector, but you gently move your camera to the left, it switches the sprite because of the dot operation)
    Thanks :)

    • @Miziziziz
      @Miziziziz  5 років тому +4

      Try replacing the players forward vector with the direction from the player to the sprite

    • @archery171093
      @archery171093 5 років тому +1

      Miziziziz thanks for the extremely fast reply ! As I’m new to godot can you shortly explain to me how to do it ?

    • @Miziziziz
      @Miziziziz  5 років тому +5

      @@archery171093 basically (sprite_pos - player_pos).normalized() will give you the direction

  • @stlingt
    @stlingt 2 роки тому +2

    Tried this today and it doesn't seem to work anymore, i think the set_camera function isn't doing its thing, any ideas on how to fix this?

    • @stlingt
      @stlingt 2 роки тому +2

      nvm i just got it, for those who are also curious instead of using the set_camera function you import the camera directly into the imp script using get_tree().get_root().get_node and then the path to the camera

    • @woodsmith3124
      @woodsmith3124 2 роки тому +1

      @@stlingt Still not working. Can you elaborate?

    • @Fishy_Chameleon
      @Fishy_Chameleon 2 місяці тому

      @@woodsmith3124 bit late but for me I just got whatever the current main camera is, as that's what you'd want to rotate the sprites off of anyways at all times, so setting the camera variable to
      get_viewport().get_camera_3d()
      should work

  • @chelsey843
    @chelsey843 5 років тому +1

    Hey, I know I'm late but could you please upload a project of this and the Wolfenstein style level on Github? Thanks a lot in advance
    PS: Your videos are fucking amazing.

  • @Renan_Medeiros
    @Renan_Medeiros 3 місяці тому

    How did you do the enemy movement? For example if enemy go to the right or left, how could i know which axis (x and z) is going to be the right and left based in camera rotation?

  • @VerdeCreeper
    @VerdeCreeper 7 місяців тому

    Do you have a similar script for individual images instead than a single sprite sheet?

  • @TitlePending
    @TitlePending 5 років тому +1

    I see, you want a stable build first.

    • @Miziziziz
      @Miziziziz  5 років тому

      Yeah I tried doing this in the beta and it crashed several times

  • @levioptionallastname6749
    @levioptionallastname6749 5 місяців тому

    spent like two hours on this in godot 4, was super careful for like 2 hours- it simply won't work and returns to frame "0" constantly,- weird :(

    • @bertangokalp9002
      @bertangokalp9002 3 місяці тому +1

      Did you fix it?

    • @levioptionallastname6749
      @levioptionallastname6749 3 місяці тому +1

      @@bertangokalp9002 totally

    • @bertangokalp9002
      @bertangokalp9002 3 місяці тому

      @@levioptionallastname6749 Oh, can you explain for me 🙏🏻

    • @froxdoggaming3385
      @froxdoggaming3385 Місяць тому

      @@levioptionallastname6749 I don't want to sound rude here, but please don't say "nvm i fixed it" and then not give any details like this

  • @KelKidGamez
    @KelKidGamez 5 років тому

    How do you make the coding for like 8 sides of a character

  • @matkdiezmo8577
    @matkdiezmo8577 4 роки тому

    Is there a way to make a 16 directional sprite? I'm still new to Godot.

  • @sharpeye6366
    @sharpeye6366 2 роки тому

    Doom 3?

  • @little3rddegreeburns
    @little3rddegreeburns 5 років тому

    Is it possible to transition from 2D to 3D within a game in godot?

    • @HonsHon
      @HonsHon 4 роки тому

      It is possible. I would say you can bring your assets over, but you have to redo all of the logic

  • @stabbedbyapanda
    @stabbedbyapanda Місяць тому

    Ok got it working on Godot 4, with just a few minor changes. It actually works almost 95% out of the box. Which is a bit surprising, ty.
    - Made this one positive instead of negative: "var player_fwd = camera.global_transform.basis.z"
    - if you already have some form of AI, you need to make sure that it rotates to look at the player and what not. So i had to ensure i had something like
    "func look_at_player():
    self.look_at(player.global_transform.origin)"
    - i'm not sure how he just called flip_h and it worked(Oh just realized what it is, the animatedsprite is the root), maybe i missed something but i just called the animatedsprite3D, for example:
    "$AnimatedSprite3D.flip_h = false"
    - For people having the stuck at frame 0 issue i can't help sadly because i called animations instead of selectin specific cells in a sprite sheet :(

    • @froxdoggaming3385
      @froxdoggaming3385 Місяць тому

      Using animatedsprite seems harder than the way shown in the video, how did you do it?

    • @stabbedbyapanda
      @stabbedbyapanda Місяць тому

      @@froxdoggaming3385 Yeah i know theres a better way than how i did it, just can't think of it off the top of my head, and it works so eh not too worried.
      But basically where he says do "row = SpriteFrame" I just say to play the animation. Then i have really nasty if statements for each of those based on the animation i want to play, like shoot, idle, move, and hit...
      I could do an enum at the start that is checked then just play specific enum direction but i havent messed with enum in Gdscript so meh.

  • @Blenderislove
    @Blenderislove 3 роки тому

    would this work in multi player situation?

    • @shwetanksingh2156
      @shwetanksingh2156 3 роки тому

      I think no you need to figure out how will it look like from other player's perspective

  • @longjohn7992
    @longjohn7992 Рік тому +1

    Doesn’t work.

  • @Minthy445
    @Minthy445 Рік тому

    can you do in roblox studio?