Hey, how would I make certain sprites not play if they're invisible? I'm guessing I'd need a global script but I'm having trouble with it, so hard to understand.
This is one of the best tutorial that provide of what i need for my project, i look hard in youtube for finding this kind of tutorial for godot but no luck, also the tutorial is easy to follow and very understandable, im sure giving more time on designing the thumbnail will increase the views greatly.
Just wanted to point out to anyone using Godot 4.0 that the onready keyword is now @onready in 4.0. If your getting identifier errors this is probably why.
Guys if you're following tutorial and having in 2023 problem with “ invalid get index ‘body_spritesheet’ (on base: ‘GDScript’) “ at function _ready in Player script. You can try to create script in CompositeSprites (Player node) and past there preloads, then instead of using const const/var with composite_sprites just make bodySprite.texture = $CompositeSprites.body_spritesheet[0] and same for others -> worked for me.
@@brandonstone2754 You are right, but I generally feel pretty gross not having scripts associated with nodes and referencing those scripts. I think @MB_Arssin has the right of it.
You can't describe my relief, I've been looking for a tutorial/guide on how to implement these things and I swear I've been looking everywhere without luck. Thanks for the video
Amazing tutorial, really helped me a lot. A small tip for everyone watching, if you put the compositedsprites into a viewcontainer->viewport. You can apply a material to the rendered end result instead on each sprite separate, which is probably going to give you the effects you want to. A character outline is a very common example (you can also put the character itself in a viewport of course but I prefer keeping the viewport inside your character as it allows you to keep al the rendering complexity inside the player script)
this was exactly what i was looking for, theres literally no other video that was as clear and perfect for what i wanna do as this- even down to using aseprite omg i love you
@0:23 I think this was unintended, but the sudden switch from beautiful pixel art to 1990's 3D rendering made me laugh when the "Select skin colour and gender" graphic popped up. Was not expecting such a switch. I'm not sure what the game-play will be like, but hopefully I'll be able to see it in a future video.
I know this probably isn't the place for it, but for your game, you might want to learn how to do sub-pixel sprite animations, as the one thing I immediately noticed when I started watching this video is how 'extreme' the breathing animation feels, and I think you could make that look a lot softer and more natural if you were to do some sub-pixel painting on it. Just a suggestion, your sprites already look good, but it would be a real boost to the general quality. Thanks for the video!
Nice. This helps in a current project. Now I just have to work out how best to change collision shapes and some other features when the sprite is changed.
I’ve followed your video to 5:57 and got “ invalid get index ‘body_spritesheet’ (on base: ‘GDScript’) “ at function _ready in Player script. I don’t know what to do with it 🥺. Thank you for the good tutorial though, It’s easy to follow but I don’t know why I got an error.
Hi is this tutorial outdated? Because at around 5:50 once i run the player scene i get the error "Invalid get index 'body_spritesheet' (on base: 'GDScript')." Anyone able to help me out with this? I'm pretty new to godot and coding any explanation would also be apreciated ;)
Hi, i don't know if is there anyone still here but i have some trouble about button if "curr_hair = (curr_hair + 1)% composite_sprites.hairM_spritesheet.size()" is next hair types so i use "curr_hair = (curr_hair - 1)% composite_sprites.hairM_spritesheet.size()" for previous hair but it crash when curr_hair = 0 and i keep press prev button , is there anyway to fix it ?
This is fantastic, thanks. Just curious (I am new to Godot) how do you handle the animations with a custom character like that? The sprite set I am using has different sprites for all the pieces like you have, but it also has it for tons of actions, axe, pickaxe, hoe, sword, etc. I can figure out how to apply the right sprites easily enough, but how do you handle the actual animation player and animation tree? Since the animation player asks for specific sprite locations for each thing.
So you have to draw the character ilike 3000 times? when i want the character to be able to turn in four directions and then be able to walk in those four directions as well, and use weapons. :S
Hi Arkeve. I love your video, how do I use the character with the hair and clothes after I choose in the game? do you have any coding that explain that part?
@@Arkeve I did it, works great! Now to figure out how to use generated sprites for npcs and save one for the main character (and make sure no npcs look exactly like the main character and stuff.) I'm really happy about this. Thanks!
Hey Arkeve! This Tutorial is great! It's been a godsend for my project. One thing I am curious about is how to animate all of these disparate sprites. Im finding that animationplayer can only play one sprite sheet at a time. I see that you have gotten this to work in your actual project. How did you do it?
I am struggling with this. How do I keep the sprites I selected in the next room? How do I make my created sprites global? When I use this and go to the next room, it is invisible.
So I was trying to implement this but ran into an issue. Basically when I made a second button to go back a sprite, the size() wraparound didn't work. It works fine when adding, but once I hit zero and try to subtract 1 it quits out on me. On_button_pressed current_hair = (current_hair - 1) % composite_sprites.Hair_spritesheet.size() HairSprite.texture = composite_sprites.Hair_spritesheet[current_hair] Any idea what I'm doing wrong? I figure if it works with +1 it should work with -1?
and of course, now that I posted it I figured out a work around. Simply replaced -1 with +24. Since there are 25 sprites in the dictionary, this an easy way to manually get around the issue of descending into negative numbers. Thought about deleting but maybe someone else will run into the same issue.
Hi! So at around 5:48 I am getting this error "Invalid get index 'body_spritesheet' (on base: 'GDScript')." I tried to search forums but everyone said it was an error with hierarchy of the nodes. I doubled checked it and have re did this tutorial a couple of times, but It still tends to not work. Any suggestions?
How would one make it possible to switch the gender of the character which then switches which clothing or hair its able to use (if this question makes sense)
Hello! This video is amazing! Can you perhaps make a separate video on saving the customized skin and how to work this skin as a player? I'm quite new to both Godot and coding. Doesn't only kinematicbody work as a player? (heard something like that in one of the videos I watched about Godot) Thank you!
Yeah all you would have to do is change the type of the Player node to be kinematic body. And keep the Sprites node as a child and should work the same way.
@@bordercolliestudios984 Hii Idk if the actual guy who made this will reply but what did you do to implement the character into another scene? I don't exactly understand his explanation. Thanks!
I use a pixel editing program called aseprite to make sprites. Check out my other tutorial about equipping and animating weapons to see how to make sprites move.
I appreciate the tutorial, but I got super lost. No idea what that $ sign should mean. I'm trying to make a character that is divided in 3 parts and the arms move when he is attacking, then is supposed to return to where it would be if the character didn't attack. I though I could use this, but I just couldn't keep up =\ Anywhere I can learn more about it?
The $ means get_node("What/You/Put/Here"), which just traverses and returns the node at that position in the hierarchy. You can learn more at: docs.godotengine.org/en/stable/getting_started/scripting/gdscript/gdscript_basics.html. You should look into asking for help at: www.reddit.com/r/godot/ or discord.gg/4JBkykG as well for more specific questions.
how did you animate all the different parts of the character? Did you hand draw animations for each item added to the game like...the running animation for the pants and shirts on the arms and such?
Yeah, I had to draw each frame. I could reuse some frames for certain situations (e.g. idle animation is similar for most the frames). Also for equipment (such as a sword) I only had to draw it once and played with position & rotation within the game engine without having to draw it each frame.
Yeah it would require you to do that, there are ways you can reduce the amount of work you do by reusing frames in certain instances. For example you can separate the shirt torso and sleeves and reuse the shirt torso for all the frames and just draw in the sleeves. With pixel art, the more customization you want to do the more work you generally have to do especially if you have a lot of animations. I usually try to be cautious adding more animations and try to reuse already drawn frames if i can to reduce work down the line.
You would just set the sprites within your player scene to the ones you selected during customization. But you would have to make sprites for the clothing and rest for animations such as walking, attacking, etc.
How you save it can be flexible, for instance you can save the spritesheet paths for each clothing into a JSON file and load your textures using the paths saved.
The concept should be the same, I figure you would have multiple meshes and stitch the meshes together. If you want to change something e.g. the face you would swap the face mesh with another one.
@@Arkeve Thank you, Arkeve-sensei I've looked for godot character customization for a while and I'm glad I got here. I look forward to attending your next lesson
My, my! it worked!! If anyone had trouble with the button, I suggest making or reconnecting a new signal to it deleting the same one, cause my item names were different. But this video really works!! LOVE IT! My question is, how did you stop the player movement? I made a different scene and attached the buttons to that scene cause the Player node of mine can't have buttons because it is the actual moving player on the levels.
thank you very much the result is awesome. I just... want to say something feels awkward inside my feelings. too many same code dyping. this code is WET.
There's something weird about this video. You're preloading a script with your composite sprites, which shouldn't do anything. Scripts don't really function outside of nodes in Godot, unless you make them singletons, in which case you wouldn't preload them, you'd just reference them directly. I think there must be something else going on in this video, and the preloading of a script is not what you want to be showing people, as it's not good practice, unless for some reason you need to attach the script to a node dynamically (in which case I'd just load a whole scene instead of just the script).
What I don't get is why do people keep making the gender thing in customization menus. Why not simplify it and make a single body and you can customize it as much as you want? Isn't that a simpler way to do it? Separating it by gender is so pointless
Hey y'all! Also check out this video about attaching and animating weapons: ua-cam.com/video/GPYBNdYuSD8/v-deo.html
Let me know what you think!
Hey, how would I make certain sprites not play if they're invisible? I'm guessing I'd need a global script but I'm having trouble with it, so hard to understand.
Can you put the download link for the font you are using!?!?!!
This is one of the best tutorial that provide of what i need for my project, i look hard in youtube for finding this kind of tutorial for godot but no luck, also the tutorial is easy to follow and very understandable, im sure giving more time on designing the thumbnail will increase the views greatly.
Just wanted to point out to anyone using Godot 4.0 that the onready keyword is now @onready in 4.0. If your getting identifier errors this is probably why.
You can also hold ctrl or command when grabbing a node in the tree into the script to drop the whole @onready line in a simple click. 👏
Guys if you're following tutorial and having in 2023 problem with “ invalid get index ‘body_spritesheet’ (on base: ‘GDScript’) “ at function _ready in Player script.
You can try to create script in CompositeSprites (Player node) and past there preloads, then instead of using const const/var with composite_sprites just make bodySprite.texture = $CompositeSprites.body_spritesheet[0] and same for others -> worked for me.
You can also make it a singleton
@@brandonstone2754 You are right, but I generally feel pretty gross not having scripts associated with nodes and referencing those scripts. I think @MB_Arssin has the right of it.
Thank you very much for this
Lifesaver, thanks!
thank you!!!!
This was very helpful man thank you! Was able to use this logic to script a clothing randomizer for procedural generated NPCs.
Glad I was able to help!!
please advise if u will show the process, Im searching info to make a proc generated items
You can't describe my relief, I've been looking for a tutorial/guide on how to implement these things and I swear I've been looking everywhere without luck. Thanks for the video
Amazing tutorial, really helped me a lot. A small tip for everyone watching, if you put the compositedsprites into a viewcontainer->viewport. You can apply a material to the rendered end result instead on each sprite separate, which is probably going to give you the effects you want to. A character outline is a very common example (you can also put the character itself in a viewport of course but I prefer keeping the viewport inside your character as it allows you to keep al the rendering complexity inside the player script)
this was exactly what i was looking for, theres literally no other video that was as clear and perfect for what i wanna do as this- even down to using aseprite omg i love you
It seems you do not have the recognition you deserve, I'll watch this video a lot to try to help you out as much as you helpd me. Thank you!
Looks really good.
Thanks for making these vids! Keep up the good work.
@0:23 I think this was unintended, but the sudden switch from beautiful pixel art to 1990's 3D rendering made me laugh when the "Select skin colour and gender" graphic popped up. Was not expecting such a switch.
I'm not sure what the game-play will be like, but hopefully I'll be able to see it in a future video.
Haha you are right! It is pretty jarring. I plan to release some gameplay videos soon!
Awesome!
Thanks for the tutorials, cant wat to check the devlogs. You earned the sub!
Holy 😳 u gained a new subscriber dude ur talented
Hot tutorial, Dad. Very straight forward and easy to understand! I subbed
great work man !!! thanks for making tutorial for this, it's really help me learning godot
I know this probably isn't the place for it, but for your game, you might want to learn how to do sub-pixel sprite animations, as the one thing I immediately noticed when I started watching this video is how 'extreme' the breathing animation feels, and I think you could make that look a lot softer and more natural if you were to do some sub-pixel painting on it. Just a suggestion, your sprites already look good, but it would be a real boost to the general quality. Thanks for the video!
Nice. This helps in a current project. Now I just have to work out how best to change collision shapes and some other features when the sprite is changed.
Thank you, because of this video I was inspired to design something similar for a Godot Game Jam I will be doing soon.
Great tutorial. Do you have one for writing the name like in 0:03 that you type John?
I’ve followed your video to 5:57 and got “ invalid get index ‘body_spritesheet’ (on base: ‘GDScript’) “ at function _ready in Player script. I don’t know what to do with it 🥺. Thank you for the good tutorial though, It’s easy to follow but I don’t know why I got an error.
Same
8:50 How did you swap words only within the selected area?
Is there any convenient way to combine this kind of approach with having many animations in different spritesheets?
Hi is this tutorial outdated? Because at around 5:50 once i run the player scene i get the error "Invalid get index 'body_spritesheet' (on base: 'GDScript')." Anyone able to help me out with this? I'm pretty new to godot and coding any explanation would also be apreciated ;)
Looks phenominal! I'm very new to Godot and trying to figure out how to make one of these, and this helps my 0 code knowledge brain.
Thanks man!
Glad I could help!
Thanks sir, is what I need this information. It really helps to me.
Glad I could help!!
Hi, i don't know if is there anyone still here
but i have some trouble about button
if "curr_hair = (curr_hair + 1)% composite_sprites.hairM_spritesheet.size()" is next hair types
so i use "curr_hair = (curr_hair - 1)% composite_sprites.hairM_spritesheet.size()" for previous hair
but it crash when curr_hair = 0 and i keep press prev button , is there anyway to fix it ?
Thanks a lot , you have helped me complet my game.
This is awesome. Thank you!
This is fantastic, thanks. Just curious (I am new to Godot) how do you handle the animations with a custom character like that? The sprite set I am using has different sprites for all the pieces like you have, but it also has it for tons of actions, axe, pickaxe, hoe, sword, etc. I can figure out how to apply the right sprites easily enough, but how do you handle the actual animation player and animation tree? Since the animation player asks for specific sprite locations for each thing.
Can you do a video on how to animate a custom character?
So you have to draw the character ilike 3000 times? when i want the character to be able to turn in four directions and then be able to walk in those four directions as well, and use weapons. :S
Hi Arkeve. I love your video, how do I use the character with the hair and clothes after I choose in the game? do you have any coding that explain that part?
great tutorial, thank you!
Thank you. Inspiring, I'm going to try this.
Let me know how it goes!
@@Arkeve I did it, works great! Now to figure out how to use generated sprites for npcs and save one for the main character (and make sure no npcs look exactly like the main character and stuff.)
I'm really happy about this. Thanks!
0:04 John Miner
Hey Arkeve! This Tutorial is great! It's been a godsend for my project. One thing I am curious about is how to animate all of these disparate sprites. Im finding that animationplayer can only play one sprite sheet at a time. I see that you have gotten this to work in your actual project. How did you do it?
Never Mind! You show it in the next episode. Even Godot Documentation doesnt have this feature listed. Thank you a million!!!!!
Glad I could help! Good luck on your project!! :D
There's more episodes? Well, crap, this has made my weekend, thanks. Glad I saw these comments. I'm going to enjoy this
I am struggling with this. How do I keep the sprites I selected in the next room? How do I make my created sprites global? When I use this and go to the next room, it is invisible.
I have a new problem.. Since I have many preloaded suff my game has lag. barely can't move my character.
So I was trying to implement this but ran into an issue. Basically when I made a second button to go back a sprite, the size() wraparound didn't work. It works fine when adding, but once I hit zero and try to subtract 1 it quits out on me.
On_button_pressed
current_hair = (current_hair - 1) % composite_sprites.Hair_spritesheet.size()
HairSprite.texture = composite_sprites.Hair_spritesheet[current_hair]
Any idea what I'm doing wrong? I figure if it works with +1 it should work with -1?
and of course, now that I posted it I figured out a work around. Simply replaced -1 with +24. Since there are 25 sprites in the dictionary, this an easy way to manually get around the issue of descending into negative numbers. Thought about deleting but maybe someone else will run into the same issue.
Hi! So at around 5:48 I am getting this error "Invalid get index 'body_spritesheet' (on base: 'GDScript')." I tried to search forums but everyone said it was an error with hierarchy of the nodes. I doubled checked it and have re did this tutorial a couple of times, but It still tends to not work. Any suggestions?
OH GOSH IM DUMB I MADE A VAR INSTEAD OF A CONST
@@doogl3661 I get the same error and i used cost could you help?
I have the same error, though i am using Const anyone able to help me out with this?
How would one make it possible to switch the gender of the character which then switches which clothing or hair its able to use (if this question makes sense)
I have a problem. When I change the hair, clothes, etc., the skin tone is also changing.
hey @Arkeve would you be willing to make a tutorial about a save system for this character customization?
hell ya, thank you for this!
No problem!!
What was the game you had right there in the Top Right?
how much time did this take you to make?
This tutorial makes my game lag. Is there a work around if I use AnimationPlayer?
Hello! This video is amazing! Can you perhaps make a separate video on saving the customized skin and how to work this skin as a player? I'm quite new to both Godot and coding. Doesn't only kinematicbody work as a player? (heard something like that in one of the videos I watched about Godot) Thank you!
Yeah all you would have to do is change the type of the Player node to be kinematic body. And keep the Sprites node as a child and should work the same way.
Thank you so much!!!!!
@@bordercolliestudios984 Hii Idk if the actual guy who made this will reply but what did you do to implement the character into another scene? I don't exactly understand his explanation. Thanks!
How to save player
What Sprite maker do you use? also can you also do a tutorial for using the characters sprite in game or moving?
I use a pixel editing program called aseprite to make sprites. Check out my other tutorial about equipping and animating weapons to see how to make sprites move.
Thanks!
Thank you. You helped me!
good if you could do a viewo onl loading and saving the characters :)
Great tutorial! The one thing I can't figure out however is how to make the buttons work, when I press on them nothing happens
use on_button_pressed signel
how do i change particle texture like this
Nice, Thanks
I appreciate the tutorial, but I got super lost. No idea what that $ sign should mean. I'm trying to make a character that is divided in 3 parts and the arms move when he is attacking, then is supposed to return to where it would be if the character didn't attack. I though I could use this, but I just couldn't keep up =\
Anywhere I can learn more about it?
The $ means get_node("What/You/Put/Here"), which just traverses and returns the node at that position in the hierarchy. You can learn more at: docs.godotengine.org/en/stable/getting_started/scripting/gdscript/gdscript_basics.html. You should look into asking for help at: www.reddit.com/r/godot/ or discord.gg/4JBkykG as well for more specific questions.
so you keep all of the sprites in different animators and run then in the same frame or there is an way to compose them together in one animator?
You can animate multiple sprites within one AnimationPlayer, you just change the frames for all the sprites within the player
okay so if I have say 200 hair styles, I have to make 200 sprite node?
yes and also make those 200 into every animation. :D
I wish there was something like this for unity :( This is exactly what I need
We are 2
there is, i can share if you are still looking. if not sry for necroing lol
Well, it's great
Hi. This is great. But what if I have animated sprites instead of only sprites? Does it work?
how did you animate all the different parts of the character? Did you hand draw animations for each item added to the game like...the running animation for the pants and shirts on the arms and such?
Yeah, I had to draw each frame. I could reuse some frames for certain situations (e.g. idle animation is similar for most the frames). Also for equipment (such as a sword) I only had to draw it once and played with position & rotation within the game engine without having to draw it each frame.
It looks cool, but do I have to make animations for each clothing? That means 3 different walking down animations for 3 different shirts???
Yeah it would require you to do that, there are ways you can reduce the amount of work you do by reusing frames in certain instances. For example you can separate the shirt torso and sleeves and reuse the shirt torso for all the frames and just draw in the sleeves. With pixel art, the more customization you want to do the more work you generally have to do especially if you have a lot of animations. I usually try to be cautious adding more animations and try to reuse already drawn frames if i can to reduce work down the line.
@@Arkeve Alright, thx. Your game looks interesting btw
how to customize character and play with the same character
You would just set the sprites within your player scene to the ones you selected during customization. But you would have to make sprites for the clothing and rest for animations such as walking, attacking, etc.
Cool.
Thank you!!!!!!
Thx for this video
skin color?
How do you make your costumes save system
How you save it can be flexible, for instance you can save the spritesheet paths for each clothing into a JSON file and load your textures using the paths saved.
Buddy which software you use for character
I use aseprite for pixel editing
Arkeve-sensei,
Does the 3d one work the same way?
The concept should be the same, I figure you would have multiple meshes and stitch the meshes together. If you want to change something e.g. the face you would swap the face mesh with another one.
@@Arkeve Thank you, Arkeve-sensei
I've looked for godot character customization for a while and I'm glad I got here. I look forward to attending your next lesson
My, my! it worked!! If anyone had trouble with the button, I suggest making or reconnecting a new signal to it deleting the same one, cause my item names were different. But this video really works!! LOVE IT! My question is, how did you stop the player movement? I made a different scene and attached the buttons to that scene cause the Player node of mine can't have buttons because it is the actual moving player on the levels.
thank you very much the result is awesome. I just... want to say something feels awkward inside my feelings. too many same code dyping. this code is WET.
There's something weird about this video. You're preloading a script with your composite sprites, which shouldn't do anything. Scripts don't really function outside of nodes in Godot, unless you make them singletons, in which case you wouldn't preload them, you'd just reference them directly. I think there must be something else going on in this video, and the preloading of a script is not what you want to be showing people, as it's not good practice, unless for some reason you need to attach the script to a node dynamically (in which case I'd just load a whole scene instead of just the script).
If any of y'all know how to do this in unity, hmu
Your sprites look like rpg maker's
Insomnia cured
What I don't get is why do people keep making the gender thing in customization menus. Why not simplify it and make a single body and you can customize it as much as you want? Isn't that a simpler way to do it? Separating it by gender is so pointless
Put me straight to sleep
Awesome!!!