User Tools

Site Tools


reset_entity_rotation

This is an old revision of the document!


Reset Entity Rotation


Resets the entity's rotation to its original cardinal direction (north, south, west, or east) over the specified duration (in seconds).

Signature:

reset_entity_rotation(entity, duration)
ArgumentDescriptionTypeRequired
entityEntity for which the rotation will be reset.EntityYes
durationDuration of the rotation (in seconds).NumberYes

This function assumes that the entity was previously rotated using Rotate Entity Towards to face it towards another entity in the scene.

Example:

reset_entity_rotation(entity["dungeon_slime"], 0.5)

Results: The entity with an ID of “dungeon_slime” is rotated to face its original direction (north, south, west, or east) over a duration of 0.5 seconds.

Use the Reset Entity Rotation function to reset the player character or an NPC back to the direction they were facing prior to a cutscene, in particular when they were manually rotated to look at an object or another character.


Editor Node:

Visual Demo:

reset_entity_rotation.1589560607.txt.gz · Last modified: 2020/05/15 09:36 by justin