Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by kurisukun

I have two entities (EntityPlayer) and another "normal" entity that Ive set to:

type: ig.Entity.TYPE.B

And in my player code:

checkAgainst: ig.Entity.TYPE.B,

So when I walk into the NPC, my player code's check() method fires, but if I walk away and run into that same NPC, check() is not fired. Why does it only work once? Thank you.

1 decade ago by Yojimbo

There are possibly a few reasons why that's happening. Are you comfortable sharing more code?

1 decade ago by kurisukun

Thank you, I actually found that in my NPC code, I had to also define the check() method. This caused the check() method of my EntityPlayer to be called continuously when they were overlapping. Without the check() in the NPC entity, the EntityPlayer check() was only called once. :)

1 decade ago by Yojimbo

Glad you found it!
Page 1 of 1
« first « previous next › last »