Skip to main content

Coding a First-Person Controller in C#

  • Chapter
  • First Online:
Moving from Unity to Godot
  • 779 Accesses

Abstract

Unlike Unity, Godot doesn’t ship with any built-in character controllers, neither third-person nor first-person. So, in this chapter, we’ll create a reusable first-person controller rig from start to end in C# for Godot. Once created, we’ll be able to drag and drop first-person controls directly into any scene. The WASD keyboard keys will move the camera forward, left, backward, and right, respectively. Holding down the Shift key enables run mode and the space bar initiates a jump. Mouse movement will control head orientation, and the first-person controller overall will support many physical interactions, including gravity, collisions, ramp movement, and more. See Figure 6-1.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 16.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Alan Thorn

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Thorn, A. (2020). Coding a First-Person Controller in C#. In: Moving from Unity to Godot. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-5908-5_6

Download citation

Publish with us

Policies and ethics