Difference between revisions of "MoveTo - ObjectReference"

Jump to navigation Jump to search
386 bytes added ,  10:42, 2 September 2014
→‎Notes: added code for forcing objects to appear the correct way in the world with moveto.
imported>Terra Nova2
imported>Terra Nova2
(→‎Notes: added code for forcing objects to appear the correct way in the world with moveto.)
Line 49: Line 49:


* MoveTo can sometimes cause some pretty interesting, yet undesirable results when moving objects, such as chests, often appear in the world in really odd angles. Furthermore, as with [[SetPosition - ObjectReference|SetPosition]], MoveTo doesn't take in account for uneven terrain.
* MoveTo can sometimes cause some pretty interesting, yet undesirable results when moving objects, such as chests, often appear in the world in really odd angles. Furthermore, as with [[SetPosition - ObjectReference|SetPosition]], MoveTo doesn't take in account for uneven terrain.
**In order to "straighten" or flatten out an object is to call [[SetAngle - ObjectReference|SetAngle]], using the following code:
<source lang="papyrus">
ObjectReference TempRef = myObject.MoveTo(Game.GetPlayer(), 0.0, 0.0, 0.0)
TempRef.SetAngle(0, Game.GetPlayer().GetAngleY(), Game.GetPlayer().GetAngleZ())
</source>
**This is not required for actors being moved with this function.
== Bugs ==
== Bugs ==
* If an actor is already in the cell, and the player is also in the cell, leaving the cell, or arriving in the cell, MoveTo() does not function. As cells can be quite large in cities and multi-level buildings, ensuing dialogue can occur with the actor out-of-sight and/or out-of-hearing. Try [[DisableNoWait - ObjectReference|DisableNoWait]](), MoveTo(), [[EnableNoWait - ObjectReference|EnableNoWait]](), [[EvaluatePackage - Actor|EvaluatePackage]]() sequence. Take care that the sequence happens out-of-sight of the player, such as during passage through a loading [[Door|door]].
* If an actor is already in the cell, and the player is also in the cell, leaving the cell, or arriving in the cell, MoveTo() does not function. As cells can be quite large in cities and multi-level buildings, ensuing dialogue can occur with the actor out-of-sight and/or out-of-hearing. Try [[DisableNoWait - ObjectReference|DisableNoWait]](), MoveTo(), [[EnableNoWait - ObjectReference|EnableNoWait]](), [[EvaluatePackage - Actor|EvaluatePackage]]() sequence. Take care that the sequence happens out-of-sight of the player, such as during passage through a loading [[Door|door]].
Anonymous user

Navigation menu