Page 1 of 1
Is there any way to make an object collide only with objects I want?
Posted: Tue Jan 01, 2019 11:34 pm
by Ol1vver
Hello,
Is it possible to make an object collide only with the objects I want?
For example:
I want an InvisibleBlock to only collide with players, but nothing else, and another one to collide with everything except players.
Re: Is there any way to make an object collide only with objects I want?
Posted: Wed Jan 02, 2019 2:40 am
by Pricey
Use AlterCollision tiles.
Re: Is there any way to make an object collide only with objects I want?
Posted: Wed Jan 02, 2019 1:24 pm
by Ol1vver
Pricey wrote: ↑Wed Jan 02, 2019 2:40 am
Use AlterCollision tiles.
And how am I supposed to do that? Select all the objects in the entire map? And what about players only collision? smh
Re: Is there any way to make an object collide only with objects I want?
Posted: Wed Jan 02, 2019 4:07 pm
by Pricey
Ol1vver wrote: ↑Wed Jan 02, 2019 1:24 pm
Pricey wrote: ↑Wed Jan 02, 2019 2:40 am
Use AlterCollision tiles.
And how am I supposed to do that? Select all the objects in the entire map? And what about players only collision? smh
You know you would really benefit from looking in the map editor yourself, there is literally a tutorial map AND a help section that answers this question for you.
Re: Is there any way to make an object collide only with objects I want?
Posted: Wed Jan 02, 2019 5:41 pm
by Gurt
Use the IObject.GetCollisionFilter() and IObject.SetCollisionFilter(...) respectively as you need. This is advanced topic and you need to know how the Box2D engine works and operate with their categorybits and maskbits. You will also have to analyze which bits you need to change and how based on how you want the collision to be altered. SFD uses a lot of different collision categories for different purposes.
I recommend that you do not alter default collision behavior for any tile unless you have a very good reason to do so.