Difference between revisions of "MoveTo - ObjectReference"
Cleaned up grammar; fixed code example.
imported>Terra Nova2 (→Notes: added code for forcing objects to appear the correct way in the world with moveto.) |
imported>Chesko (Cleaned up grammar; fixed code example.) |
||
Line 48: | Line 48: | ||
* Making an actor MoveTo() a furniture reference will make the actor immediately assume the position of "using" that furniture, without playing the furniture entrance animation. Example: PlayerRef.MoveTo(BedReference) will make the player lie down on the bed reference (without playing the bed entrance animation). | * Making an actor MoveTo() a furniture reference will make the actor immediately assume the position of "using" that furniture, without playing the furniture entrance animation. Example: PlayerRef.MoveTo(BedReference) will make the player lie down on the bed reference (without playing the bed entrance animation). | ||
* MoveTo can | * MoveTo can cause undesirable results when moving an object to another actor, whose X and Y rotation angles are relative to that actor's looking angle, not their rotation relative to the world. Furthermore, as with [[SetPosition - ObjectReference|SetPosition]], MoveTo doesn't take uneven terrain into account. | ||
**In order to "straighten" or flatten | **In order to "straighten" or flatten an object's rotation, set the abMatchRotation parameter to False, or call [[SetAngle - ObjectReference|SetAngle]] similar to the following: | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
myObject.MoveTo(Game.GetPlayer()) ;Or, whatever the target of the MoveTo() is | |||
myObject.SetAngle(0.0, 0.0, 0.0) | |||
</source> | </source> | ||
* | * Actors moved with this function are always rotated correctly relative to the world. | ||
== Bugs == | == Bugs == |