- Godot Engine Game Development Projects
- Chris Bradfield
- 162字
- 2021-06-18 18:51:26
Creating the scene
Start by clicking the Add/Create a New Node button and selecting an Area2D. Then, click on its name and change it to Player. Click Scene | Save Scene to save the scene. This is the scene's root or top-level node. You'll add more functionality to the Player by adding children to this node:
Before adding any children, it's a good idea to make sure you don't accidentally move or resize them by clicking on them. Select the Player node and click the icon next to the lock:
The tooltip will say Make sure the object's children are not selectable, as shown in the preceding screenshot.
It's a good idea to always do this when creating a new scene. If a body's collision shape or sprite becomes offset or scaled, it can cause unexpected errors and be difficult to fix. With this option, the node and all of its children will always move together.