Frictional Games Forum (read-only)

Full Version: How to use "Automatic walking script!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey all, just wanna ask, I'm making with my friend new Amnesia mod and I'm planning to do Intro, but we don't know how to make player walk "automatically on certain point" how you do this?  Huh

Please, help us. Smile
The only built-in script for doing this is MovePlayerForward. As the name says, you can only move them forward, not sideways. If you want to run this script you need to put it inside a looping timer.

PHP Code:
void OnStart()
{
    
// ...
    
TimerWalkForward("");
}

void TimerWalkForward(string &in asTimer)
{
    
MovePlayerForward(10.0f);
    
AddTimer("loop"0.1f"TimerWalkForward");


To stop the walking, use RemoveTimer("loop");
(02-28-2019, 12:50 PM)Mudbill Wrote: [ -> ]The only built-in script for doing this is MovePlayerForward. As the name says, you can only move them forward, not sideways. If you want to run this script you need to put it inside a looping timer.

PHP Code:
void OnStart()
{
 
   // ...
 
   TimerWalkForward("");
}

void TimerWalkForward(string &in asTimer)
{
 
   MovePlayerForward(10.0f);
 
   AddTimer("loop"0.1f"TimerWalkForward");


To stop the walking, use RemoveTimer("loop");

Thank you so much, it works now. Smile