set view angle by dirX and dirY
Problem it solves
You want your player camera to rotate toward a specific target coordinate vector.
What this block does
Sets the camera facing direction based on X and Y direction vector components.
The block
Block ID: rcRender_setViewAngle
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
| dirX | number | Horizontal direction vector component. | |
| dirY | number | Vertical direction vector component. |
Returns
void — Nothing.
Example
Render.setViewAngle(0, -1)
Add the extension
Add github:The-Code-Zone/Raycasting-pxt-extension to your project, or open: Import Raycasting-pxt-extension.