Skip to main content
TikTok Effect House Platform Logo
Latest
Download
Log in
Transform

Reflect

Use Reflect to get the reflection vector of an input vector on a surface. Supported types: Vec2 and Vec3. Reflect is in the Transform category.

Input

NameData typeDescription
DirectionVec2The origin vector to calculate its reflection vector
NormalVec2The normal vector of the reflection surface

Output

NameData typeDescription
ResultVec2The reflection vector of A

Example

↓ Reflect.zip

We first have a checkerboard placeholder 2D object initialized to the center of the screen. Then we maintain a variable called “speed”, and initialize that with value (12, -1). Then we update the speed value if the position of the checkerboard goes beyond the vertical boundary of the screen by using the reflect node.