Accelerometer: Difference between revisions

From Fancade Wiki
(Centered the image)
mNo edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 11: Line 11:


* 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-dependent, meaning it will behave differently on different devices. Some may not even have one at all.
* When the accelerometer is used in a calculation, [[Lock screen orientation|the screen orientation locks]].


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


[[File:Accelerometer LERP.jpg|frameless|center|Smooth accelerometer]]
{{Image|Accelerometer LERP.jpg|Smooth accelerometer}}


[[Category:Blocks]]
[[Category:Blocks]]

Latest revision as of 13:53, 21 June 2025

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-dependent, meaning it will behave differently on different devices. Some may not even have one at all.
  • When the accelerometer is used in a calculation, the screen orientation locks.

Examples

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

Smooth accelerometer