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.
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 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.
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.
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
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.
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
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?
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 :)
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 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
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.