Wish I "Node" 2 (Godot Tips and Tricks)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so today I have my second quick list of things I wish I knew sooner in Godot so this line of code is a quick way to add a pause to a loop if you are spawning enemies or bullets so when adding new nodes in a script you can actually add other nodes to that first node before adding it to the scene tree just a friendly reminder to always remember the difference between a float and an integer even when you have an integer divided by an integer it will not be able to return a float this will return zero every time you can check to see what type of node the parent is when you add assets into the inspector like this it will always add it to where it is highlighted no matter where in this little box you add the asset the difference between module eight and self module eight is module eight will change all of the children and self module eight will only change the current node and not affect its children if you check for an array and it's empty it will return false when you have a script that inherits from another script you can override the functions of the original script so I have a start function here that is overriding this start function this code will run unless I put this start function here now if I want to add to the start function but still want all of that original code to work I can put dot start so the original code runs and then the additional code will run also this does not work with built-in functions like the physics process or the ready function in those cases it runs both of the scripts no matter what always remember to start your tweens so a nodes rotation and a nodes rotation degrees are the same thing the only difference is rotation is in radians and rotation degrees is in degrees sine and cosine take and return radians so if you have an angle that's in degrees you have to convert it to radians so there are three different functions that are very similar and they all have to do with loading resources or a scene in a script so the first one we have is new and you're going to use new when you are making a brand new node or some type of resource such as a curve 2d or a node 2d new you use instance when you are loading a scene that you've already made you'll be loading the path to the scene that you've previously made and you're going to make an instance of it so the duplicate function is for making a unique resource such as an animation or an animated texture that way if you make changes to it it won't affect the other parts of the game that are point from that same resource
Info
Channel: Gingerageous Games
Views: 6,579
Rating: undefined out of 5
Keywords: Godot, game, development, tips, trick, tricks, tip, help, hints, tutorial
Id: k-PZ1Kn0VeM
Channel Id: undefined
Length: 2min 55sec (175 seconds)
Published: Fri Feb 07 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.