Page 1 of 1

Is there a way to change collision box with player but not with other objects?

Posted: Tue Jun 23, 2020 9:17 am
by Impatient
Since the new beacons look ground level fort their most parts, I tried to make them walkable by reducing the collision box:

Code: Select all

data.raw["beacon"]["beacon"].collision_box = {{-0.2, -0.2}, {0.2, 0.2}}
This way the player character collides only with the spike in the middle of the beacon. Works fine - for the player character.

But the unwanted side effect is, that the beacons also can be placed overlapping. That is a no go.

Is there a way to achieve distinct collision behavior for beacons with player characters, cars, bugs, etc, and beacons with other immobile objects in the game world?

Re: Is there a way to change collision box with player but not with other objects?

Posted: Wed Jun 24, 2020 10:25 am
by darkfrei

Code: Select all

r = 1.4 -- for 3x3 entity
entity.collision_box = {{-r, -r}, {r, r}}
Disable by beacon the player layer collision mask, add hidden entity in the middle with player layer collision mask.
Don't forget to destroy the hidden entity after the the beacon entity was mined or destroyed.

Re: Is there a way to change collision box with player but not with other objects?

Posted: Wed Jun 24, 2020 5:34 pm
by Impatient
thanks!

I will try it.