Frictional Games Forum (read-only)

Full Version: PlayerStartAreas are behaving weirdly/teleport script not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've got a very strange problem.
I made a script that triggers when you touch a door; you will be teleported "behind" the door. I reality, you are teleported to a different area of the map in front of a door (some may recall this mechanic from Cry of Fear).

Here's the problem: The TeleportPlayer script does not work at all. I interacted with the door and nothing happened.
Also, now that I have placed a second PlayerStartArea, it starts me at that one when loading the level from the menu, although I have defined a different one in the custom_story_settings. wtf?

Here's my script:

void OnStart()
{
SetEntityPlayerInteractCallback("tur_raus", "Stuff", true);
}

void Stuff(string &in asEntity)
{
FadeOut(5);
AddTimer("tele", 5, "Teleport");
}

void Teleport(string &in asTimer)
{
FadeIn(5);
TeleportPlayer("draussenstart");
}

EDIT:
I kinda solved this by changing the level when you touch the door, but this still interests me. Was there an update that made the TeleportPlayer script unusable?
From my experience, TeleportPlayer works just fine. The problem is probably rather in your code.
Did you test any of the other parts? Like the FadeOut?
TeleportPlayer should still work, but alternatively you can use SetPlayerPos. The only noticeable difference is that with TeleportPlayer, the view is reset to the Y rotation of the area, but SetPlayerPos does not affect the pitch and yaw.