Accelerometer: Difference between revisions

From Fancade Wiki
(Updated and revisited the page)
m (Fix source code formatting)
Line 5: Line 5:
|output1={{Port|v|Direction}}
|output1={{Port|v|Direction}}
}}
}}
Outputs the tilt direction of the device.  
Outputs the tilt direction of the device.  


== Notes ==
== Notes ==
* The accelerometer makes the screen orientation unchangeable during gameplay when the direction output is connected to anything.
* The accelerometer makes the screen orientation unchangeable during gameplay when the direction output is connected to anything.
* The accelerometer is device-dependant, meaning it will behave diffrently on diffrent devices. Some may not even have one at all.
* The accelerometer is device-dependant, meaning it will behave diffrently on diffrent devices. Some may not even have one at all.

Revision as of 10:10, 17 May 2024

Accelerometer
Accelerometer.png
TypeScript block
ColliderNone
FolderGame
Ports
Outputs Direction

Outputs the tilt direction of the device.

Notes

  • The accelerometer makes the screen orientation unchangeable during gameplay when the direction output is connected to anything.
  • The accelerometer is device-dependant, meaning it will behave diffrently on diffrent devices. Some may not even have one at all.

Examples

The accelerometer by itself is very jumpy and not smooth at all, this can be fixed with a LERP script:

Smooth accelerometer