move with buttons velocity
Problem it solves
You want the player to walk forward/backward with Up/Down and rotate their 3D view with Left/Right, plus add realistic head-bobbing sway.
What this block does
Configures first-person player controls, setting movement speed, rotation turning speed, and camera walking sway.
The block
Block ID: rcRender_moveWithController
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
| v | number | 2 | Forward/backward walking speed (set to 0 to disable built-in controls). |
| va | number | 3 | Turning rotational speed in radians per second (set to 0 to disable). |
| cameraSway | number | 0 | Amount of camera sway / head-bobbing in pixels while walking. |
Returns
void — Nothing.
Example
Render.moveWithController(2, 3, 1)
Add the extension
Add github:The-Code-Zone/Raycasting-pxt-extension to your project, or open: Import Raycasting-pxt-extension.