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
Script Help area collide problem
jamer125 Offline
Junior Member

Posts: 6
Threads: 3
Joined: Aug 2013
Reputation: 0
#1
area collide problem

Heres a tough one, atleast for me. In my game i want an prisoner dude to appear when you enter the area, but i only want him to appear once and only if you have a key, the problem is when you walk over the area without the key turn around and walk back its deleted bc i already walked through it but if i make it so it wont be deleted then you could walk in the area over and over again with the key making the guy appear and i dont want that does this make sense?

never mind figured it out
(This post was last modified: 08-20-2013, 04:22 PM by jamer125.)
08-20-2013, 04:16 PM
Find
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#2
RE: area collide problem

Well, how about you set a variable which will determine if the key has been picked up by the player, or not yet? Then use that variable to determine if the function for your area collide will activate, or not.

Alternatively, instead of a variable, you can can use this to determine the item's state instead:

Quote:bool HasItem(string& asName);


Checks whether the player has an item in his inventory.



That's just an idea I'm throwing out. If you need more help, post your script, and we'll see if we can help you alter it properly!

[Image: Tv0YgQb.gif]
Image by BandyGrass
08-20-2013, 04:30 PM
Find
jamer125 Offline
Junior Member

Posts: 6
Threads: 3
Joined: Aug 2013
Reputation: 0
#3
RE: area collide problem

I was using that but I still collided with the box even when i didn't have the key and when you enter the box it would be delted so by the time i got the key the jumpscare wouldnt happen but i figured it out i just unactivated the area and activated it when i picked up the key
08-20-2013, 05:44 PM
Find
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#4
RE: area collide problem

Oh yeah well that works too. Glad you solved it!

[Image: Tv0YgQb.gif]
Image by BandyGrass
08-20-2013, 05:47 PM
Find




Users browsing this thread: 1 Guest(s)