Accelerometer: Difference between revisions

(Created page with "Outputs the tilt direction of the device. File:Accelerometer1.png 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. == Examples == The accelerometer by itself is jumpy and not very smooth at all, this can be fixed with the next script! [[File:]] Combined with the second script, you can make labyrinth-style...")
 
mNo edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Block
|image=Accelerometer.png
|type=s
|folder=game
|output1={{Port|v|Direction}}
}}
Outputs the tilt direction of the device.  
Outputs the tilt direction of the device.  


[[File:Accelerometer1.png]]
== Notes ==
 
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 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, [[Lock screen orientation|the screen orientation locks]].


== Examples ==
== Examples ==


The accelerometer by itself is jumpy and not very smooth at all, this can be fixed with the next script!
The accelerometer by itself is very jumpy and not smooth at all, this can be fixed with a LERP script:
 
[[File:]]
Combined with the second script, you can make labyrinth-style camera rotations that look nice on the eyes!
[[File:]]


{{Image|Accelerometer LERP.jpg|Smooth accelerometer}}


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

Latest revision as of 13:53, 21 June 2025

Outputs the tilt direction of the device.

Accelerometer
Accelerometer.png
TypeScript block
ColliderNone
FolderGame
Ports
Outputs Direction

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: