Transcript for:
Difference Between Event BeginPlay and Event Tick

hello my name is june we're going to have a quick look at what the difference is between event begin play and event tick if you find this helpful please like subscribe and hit that bell for more videos and don't forget to check out my website 3d asset library.com for unreal and unity engine assets so you can see here we often when we open up our blueprints um you'll get these these two here which is event beginplay and event tick now what we'll do is i'll just close this and we'll just go to our content browser right click blueprint class actor and we'll just give it a name say event tick and we'll drag that into our scene here so if we double over click on this and then go to event graph um you'll get this now there's three here and this one's if you know if the player overlaps with um uh if the actor overlaps with this blueprint trigger this but what we're going to do is we're going to get rid of that so often you'll start see these two and wonder what they're used for now what this is is essentially is that event begin play triggers on when the uh we play our game so for instance you could trigger a cinematic or you could trigger an explosion but this only happens once so it's um yeah that's the best way to explain it only happens once now the event tick is um will kind of constantly run as your game is going um so what will happen is if say you had an explosion you had this running you could have the explosion going exploding then pause for two seconds and explode and again a pause for two seconds exponent et cetera and but generally it's not good practice to be using the event tick on unnecessary things um because it can have a i believe it's tied to your frames per second so you can have a huge imp uh impact on your frames per second and because obviously what this is doing is rather than um i guess focusing on your game it's focusing on trying to make it reach this tick all the time so it's just constantly going to try and feed the information that's in this over and over again so um uh best way to guest explain this is that if you look at say a frames per second counter and that's essentially what that tick's doing is it's trying to constantly update this so you can imagine if you had some huge code um node workflow here it can cause a huge performance um increase depending on what you're doing um so a quick example of this is if we go to drag off event beginplay and type print and then i'll just type in there hello event begin now i'll save that and then what happens is when we go to our viewport window and press play you'll see up in the corner here we'll get this little messages says hello event begin so as you can see there it only appears once um so that's triggered once you know that's this is all we need and um so now what we'll do is we'll drag this down and we'll plug that into the tick and we'll go hello tick and you'll see the difference here that when we save that and press play you can see here it's constantly just writing text to the screen and you can see here sort of fighting with the frames per second but um obviously it's not it's not a big enough impact on on the scene so yeah that gives you a quick um look at the difference between event tick and event uh begin play as i say generally i think is good practice where you can to use the begin play and um uh to to avoid use these for special circumstances within your your game or your um film or whatever so yeah hope that helped cheers