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
Only call a function when 2 condictions are fulfilled
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#2
RE: Only call a function when 2 condictions are fulfilled

Add a collide callback for the area, and a look callback for the entity.

When the player enters the area, set a variable to true. When he leaves, set the same variable to false.
When the player looks at the entity, set another variable to true. When he stops looking, set the same variable to false.

In both functions, call a third function like: void DoStuffIfPlayerIsInAreaAndLookingAtEntity()
where you check the 2 variables.

[Image: 16455.png]
(This post was last modified: 02-12-2013, 07:47 PM by MulleDK19.)
02-12-2013, 07:47 PM
Find


Messages In This Thread
RE: Only call a function when 2 condictions are fulfilled - by MulleDK19 - 02-12-2013, 07:47 PM



Users browsing this thread: 1 Guest(s)