Accelerometer: Difference between revisions
Nikitaivanov (talk | contribs) (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...") |
(Updated and revisited the page) |
||
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. | ||
== 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. | |||
== Examples == | == Examples == | ||
The accelerometer by itself is jumpy and not | 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|Smooth accelerometer]] | |||
[[Category:Blocks]] | [[Category:Blocks]] |
Revision as of 20:23, 16 May 2024
Accelerometer
Type | Script block |
Collider | None |
Folder | Game |
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: