User Tools

Site Tools


4rpl:commands:rotateobjtowardscell

Index

RotateObjTowardsCell

RotateObjTowardsCell(<-UID “ObjName” <-posX <-posZ <-maxRotationDeg)

Description

Rotates an object so that its forward, or positive Z axis, points towards the supplied position, but with rotation confined to the plane of the map (the XZ plane). The X, Z coordinates are a position in the plane of the map. The max rotation can be limited by supplying a maxRotationDeg in degrees. If a negative value is specified for the maxRotationDeg, the rotation will move away from rather than towards the specified target location. The rotation of the obj is in world space, not unit local space.

:NOTE: The X & Z axis rotation will always be set to 0 when using this API.

Examples

RotateObjTowardsCell(self "barrel" 42 23 1)

Index

4rpl/commands/rotateobjtowardscell.txt · Last modified: 2023/07/12 02:30 by Vertu