How to switch scene using door (portal) in Godot 3? Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
- boop doop doop hmm user first-name lastname ask me how to call the dollar to another level lack in my game hammer King if you want to play it I put a link in the description especially for you if you like the asset that I used I need to say they are free and might buy pixel from ok let's start and here is the plan you need to have a kinematic character with collision shape a green color a door which is area to denote with a collision shape the blue color an event that will check the player input for example Enter key next check collision between door and character using cat overlapping bodies is a function from area to D and if everything will pass you can change the scene to the next level okay now let's do this but in the god OMG I prepared two simple levels with doors which will be our portals the player can move on the scene using arrow keys and he has our collision shape the door scene is re a node that needs to have a collision shape in this case this will be a small rectangle to detect the player the good thing is to have a physic liar's that will be detecting each other let's add the player and the door layers [Music] idea is that the player will see doors and the door will see only the player [Music] more about it you can find on my video how to use collisions in the Darr script we will use the input function to catch the input signal if the signal will equal who I accept which will be the Enter key by default we will print body count which is colliding with the door like you can see when I'm pressing enter key you can see it on the console for a better understanding we can show collision shapes in the debug mode [Music] next we need to add a reference to our scene in that our script we can export the packets a note to choose a scene from the interface another way would be to load this scene to a variable using the load function let's add a new condition in our input event to check if the programmer added a scene to the door and next add the new scene function [Music] we need our tree which is a parent of all nodes and change the current scene to our target scene I also like to add sprint errors if something crash [Music] blah news we can use the next level function on the opening animation instead of using the next level function on the infant faction you can invoke animation which I prepared earlier for the door and the player in the animation player we can use the next level function at the end of the animation [Music] in this case I'm using the next level function on the one second because the animation of the player is something like one second so we can also invoke the animation for him another nice way to use this animation for the player would be to create a custom signal and catch it in the player script and everything is working full code you can find on my github page thanks for watching leave like if you liked it dislike if you didn't and have a great day night and so on [Music]
Info
Channel: Rafa Fiedo
Views: 30,043
Rating: undefined out of 5
Keywords: godot portal, godot, godot scene change, godot help, godot engine, godot platformer, godot 2d tutorial, godot platformer tutorial, godot 2d, tutorial, godot tutorial, godot tutorial levels, godot switch between scenes, godot scene, godot scenes, godot change level on input, sheetcode, game development, game development godot, godot switch scenes
Id: AxymjihpUi4
Channel Id: undefined
Length: 5min 4sec (304 seconds)
Published: Thu Jun 11 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.