Natstep
Cross-platform step counting for Unity Engine.
Install / Use
/learn @videokit-ai/NatstepREADME
Pedometer API
Pedometer is a native pedometer API for the Unity game engine. The API provides sensor information about step count and distance covered (in meters). It is a minimalist API with native backends on iOS and Android.
Using the API
To use the API, simply create a Pedometer instance:
// Create a pedometer
// The OnStep callback will be invoked each time a step is detected
var pedometer = new Pedometer(OnStep);
void OnStep (int steps, double distance) {
// Display the values
stepText.text = steps.ToString();
// Display distance in feet
distanceText.text = (distance * 3.28084).ToString("F2") + " ft";
}
When you are done detecting steps from a Pedometer instance, you must dispose it:
// Dispose of this pedometer instance
pedometer.Dispose();
Notes
- On iOS, you must add an
NSMotionUsageDescriptionkey to theInfo.plistin Xcode before building. This determines the message used to request pedometer permissions from the user.
Credits
Related Skills
node-connect
343.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
92.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
