Look Rotation: Difference between revisions
(Updated and revisited the page) |
(→Examples: link to Object) Tags: Mobile edit Mobile web edit Advanced mobile edit |
||
(One intermediate revision by one other user not shown) | |||
Line 17: | Line 17: | ||
== Examples == | == Examples == | ||
* Make an object point to another object: | * Make an [[object]] point to another object: | ||
: {{Image|Look rotation example1.png|Example}} | : {{Image|Look rotation example1.png|Example}} | ||
* [[Angle between two vectors]] | * [[Angle between two vectors]] | ||
* Look rotation is also used to create [[inverse trigonometric functions]]. | * Look rotation is also used to create [[Break Rotation#Example|inverse trigonometric functions]]. | ||
[[Category:Blocks]] | [[Category:Blocks]] |
Latest revision as of 14:32, 23 August 2025
Look Rotation
Type | Script block |
Collider | None |
Folder | Math |
Ports | |
---|---|
Inputs | Direction Up |
Outputs | Rotation |
Create a rotation pointing in a given direction, e.g. rotating a character to look that way.
Notes
- The Up vector defaults to (0,1,0) if unwired.
- When converting one direction (vector) into a rotation, there is actually an infinite number of solutions! You can visualize this by picking up an object, say a pencil, and point it in some direction. You'll notice that you can still spin the pencil (thus changing it's rotation) without changing the direction it's pointing. That's why we define a second "Up" vector. It helps define how the pencil should be oriented.
Examples
- Make an object point to another object:
- Angle between two vectors
- Look rotation is also used to create inverse trigonometric functions.