Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Force player to look somewhere
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#3
RE: Force player to look somewhere

I'll show an example, on how you can do it.

//Creating the function to call
First: Making the game call a function when the player enters a area.

// First function
First: When the player enters the area, i set the player inactive, so the that you can't move him around.
Second: After the players is set inactive, i make him look at a torch.
Third: I create a timer, that activates the player, so that him can move around again

//Second function
Activating the player

Here is the example:

void OnStart()
{
AddEntityCollideCallback("Player", "LookArea", "StareAtTourch", true, 1);
}


void StareAtTourch(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
StartPlayerLookAt("torch_static01_1", 6.0f, 10.0f, "");
AddTimer("activate_player", 3, "activateplayer");
}


void activateplayer(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}

PS. 6.0f is the speed the camera turns around, and 10.0f is the maximum speed that the camera is aloud t oturn

CURRENT PROJECT:
A Fathers Secret == Just started
(This post was last modified: 10-12-2012, 02:40 PM by Lizard.)
10-12-2012, 02:34 PM
Find


Messages In This Thread
Force player to look somewhere - by naseem142 - 10-12-2012, 01:26 PM
RE: Force player to look somewhere - by Robby - 10-12-2012, 01:57 PM
RE: Force player to look somewhere - by naseem142 - 10-12-2012, 02:35 PM
RE: Force player to look somewhere - by Lizard - 10-12-2012, 02:34 PM
RE: Force player to look somewhere - by naseem142 - 10-12-2012, 02:53 PM
RE: Force player to look somewhere - by naseem142 - 10-12-2012, 03:07 PM
RE: Force player to look somewhere - by naseem142 - 10-12-2012, 04:28 PM



Users browsing this thread: 1 Guest(s)