Jump to content

[Scripting] Walk to


Dooge

Recommended Posts

Posted

If you want to "dynamically" have an actor to walk to a spot, specific, with a high precision on the spot, then you need something advanced.

 

Do a normal Travel Package.

Create a marker (anywhere in the world), set it to the destination of the package.

Be sure the travel to procedure ends when the spot is reached.

 

In the package add a script for the "on package start" and another for "on package end".

 

In the start and end you will do pretty much the same stuff.

 

1) Calculate the position of the xmark.

 

RotationZ = Player.RotationZ

 

posX = math.sin(player.rotationZ)*50

posY = math.cos(player.rotationZ)*50

 
(Assuming a distance of 50 is what you want.)
 
Place the xmarker to the calculated position and rotation.
 
 
The end package will be the same, but you do also a EvaluatePackage() on the actor. (So it will run again.)
 
 
To start the package on an actor do a ActorUtil.AddPackageOverride(yourPackage, false, 100)
 
And remove it when not needed anymore.
 

 

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...