Moving from Unity to Godot by Alan Thorn

Moving from Unity to Godot by Alan Thorn

Author:Alan Thorn
Language: eng
Format: epub
ISBN: 9781484259085
Publisher: Apress


Now, reselect the CollisionShape2D, and adjust the collision shape to match the character’s body. You don’t need to enclose the head, because when seen from a top-down perspective in a regular 2D level, it’s only the body that will collide with walls, doors, and objects. See Figure 4-20.

Figure 4-20Sizing the Circle Collider

This is great. We’ve got a fully configured player character. And now, finally, we can code player controls. To do this, select the root KinematicBody2D node, and create a new C# script from the Script field in the Inspector. The script should inherit from KinematicBody2D and be called PlayerControl. See Figure 4-21.

Figure 4-21Creating a New C# Script for Player Controls, Attached to the KinematicBody2D



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.