Unity — ControlFreak2 Swipe Controls

Key bindings

Using it in script

using ControlFreak2;
if ( CF2Input.GetKeyDown ( KeyCode.UpArrow ) 
|| CF2Input.GetKeyDown ( KeyCode.W ) ) {
// Move up
}
if ( CF2Input.GetKeyDown ( KeyCode.DownArrow )
|| CF2Input.GetKeyDown ( KeyCode.S ) ) {
// Move down
}
if ( CF2Input.GetKeyDown ( KeyCode.LeftArrow )
|| CF2Input.GetKeyDown ( KeyCode.A ) ) {
// Move left
}
if ( CF2Input.GetKeyDown ( KeyCode.RightArrow )
|| CF2Input.GetKeyDown ( KeyCode.D ) ) {
// Move right
}

--

--

--

Software developer. zhifez.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Better Database Management Makes Programming Efficient

Clean Code is Crucial in Software Development — Here’s Why | Data Driven Investor

computer-science-software-development-team

SXSW Startups: Secure Code Warrior

Designing a TypeScript ToDo List Application Following Clean Architecture Principles

How to be A Pragmatic Programmer: Part One (1)

Off the Cliff ep6: Substratum

WSO2 MicroGateway Observability for request failures -Ballerina Metrics

How we Migrated a Critical Feature Into a New Codebase (without regretting all our life choices)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
zhifez

zhifez

Software developer. zhifez.com

More from Medium

Exceptions/Challenges/Errors while using the Asynchronous Apex (Batch apex, Future method…

Michael: “I’ve actually managed to double my travel stats this year.”

WorldBox — A Brief Overview

Building Java-based microservices as part of a GitHub Action