Skip to content

AlignToVector

Narta Xaymar Dirks edited this page Oct 28, 2026 · 5 revisions
Blitz3D

AlignToVector

AlignToVector:Void entity:Int32, vector_x:Float32, vector_y:Float32, vector_z:Float32, axis:Int32, rate:Float32=1
Parameter Mode Type Default Description
entity In Int32 required Entity handle.
vector_x In Float32 required X part of the direction.
vector_y In Float32 required Y part of the direction.
vector_z In Float32 required Z part of the direction.
axis In Int32 required Axis that is aligned: 1 for X, 2 for Y, 3 for Z.
rate In Float32 1 How much of the turn to do, 0 to 1. Defaults to 1.

Description

Turns an entity so that one of its own axes lines up with a direction. Where PointEntity always uses +Z, this lets you choose any axis, for example to make an entity stand on a slope by aligning its Y axis to the surface normal. rate blends from the current orientation: 1 snaps at once, smaller values turn only part of the way each call, so calling it every frame gives a smooth turn.

Related Commands

CopyEntity, CountChildren

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally