This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| 4rpl:commands:rotateunittowardscell [2021/01/08 16:01] – created - external edit 127.0.0.1 | 4rpl:commands:rotateunittowardscell [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| ===== Description ===== | ===== Description ===== | ||
| - | Rotates a unit 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). | + | Rotates a unit 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 X, Z coordinates are a position in the plane of the map.\\ |
| - | The max rotation can be limited by supplying a maxRotationDeg in degrees. | + | The max rotation can be limited by supplying a maxRotationDeg in degrees.\\ |
| - | If a negative value is specified for the maxRotationDeg, | + | If a negative value is specified for the maxRotationDeg, |
| + | |||
| + | :WARNING: This API will attempt to set the X and Z rotation vectors to 0 at all times. See [[4rpl: | ||
| + | If using objects is undesirable, | ||
| + | Or for a simpler solution: ensure that the rotation from this API is weaker than other uses of RotateUnit. | ||
| ===== Examples ===== | ===== Examples ===== | ||
| <code 4rpl> | <code 4rpl> | ||
| - | RotateUnitTowardsCell(< | + | RotateUnitTowardsCell(< |
| + | </ | ||
| + | <code 4rpl> | ||
| + | GetUnitRotation(self) -> | ||
| + | RotateUnit(self V3(-25 < | ||
| + | RotateUnitTowardsCell(self < | ||
| </ | </ | ||
| < | < | ||