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
Check if something is touching an entity or area.
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#3
RE: Check if something is touching an entity or area.

(05-22-2012, 04:28 PM)Obliviator27 Wrote: void OnStart()
{
for(int i; i<7; i++){
AddEntityCollideCallback("entity_" + i, "Windowname", "BreakWindow", true, 1);
// Note that i<7 should be changed to accommodate however many entities you have, and make sure you name every entity entity_1, entity_2, and so on, or however you want to name them
}

void BreakWindow(string &in asParent, string &in asChild, int alState)
{
// Insert breaking script here.
}

Also note that that's just something I tossed together off of the top of my head.


Thats something ive been wondering for a while too steppers.Im gonna go test ^ that now.
EDIT:Yup that worked perfectly.I just removed the { from for(int i; i<7; i++){ and now it works well.

(This post was last modified: 05-22-2012, 05:27 PM by Datguy5.)
05-22-2012, 05:10 PM
Find


Messages In This Thread
RE: Check if something is touching an entity or area. - by Datguy5 - 05-22-2012, 05:10 PM



Users browsing this thread: 1 Guest(s)