Why do PINNED SOLID Object stop being SOLID on collision

Discussion and feedback on Construct 2

Post » Sun Aug 09, 2015 7:40 pm

Hi Everyone,

There is something I really don't understand and it is very inconsistent for me.
I set the pinned and solid behavior to an object. I pinned it to the player's sprite.
The player is also solid and capable of moving.

In the attached capx, the player is stopped by the black tilebackground that is solid, but none
of the pinned red circles behind him. all red circles are SOLID. But they all go through the black tilebackground.

Can somebody explain to me why this happens? Is it a bug? It doesn't make sense to me.
Thanks for your reply.

File: https://dl.dropboxusercontent.com/u/22785599/Scirra/Problem-Solid-Pined-object.capx
B
44
S
10
G
7
Posts: 183
Reputation: 10,098

Post » Sun Aug 09, 2015 9:10 pm

Without looking, I'd first say that the pinned objects are being re-positioned to wherever the player is. If the red objects contact the solid object, it doesn't tell the player to stop moving, so the player will continue to move and reposition all the pinned objects, even if they end up overlapping other solid objects.
You could try moving the red objects out of the solid object if overlapping, and also move the player in the same direction. I think the custom movement behavior allows you to push objects out of solids. You could try adding that to the red objects and pushing them out/moving player based on pre and post position of the object being pushed out.
B
48
S
23
G
66
Posts: 1,144
Reputation: 39,059

Post » Sun Aug 09, 2015 9:15 pm

(Ninja'd)
The problem is you have conflicting behaviours. Solid is saying "don't move over a certain object", and Pin is saying " ALWAYS move relative to the parent". You can't have it both ways - something has to give. So it seems Pin trumps Solid. It's not clear what you would expect to happen. Do the Blobs stop moving or do they stop the player from moving. The last won't happen as the Pin mechanism is one way. Player affects Blob, but Blob does not affect Player.

People keep trying to use behaviours with Physics, but Physics doesn't behave well with any other behaviour, in general.
ImageImageImage
B
71
S
22
G
257
Posts: 3,791
Reputation: 142,698

Post » Mon Aug 10, 2015 6:51 am

Hi @blackhornet, If you checked the capx file attached, you will see that I didn't used the physics behavior. It is only the 8 Directions, pin behavior and solid.

blackhornet wrote:Solid is saying "don't move over a certain object", and Pin is saying " ALWAYS move relative to the parent". You can't have it both ways - something has to give. So it seems Pin trumps Solid.

Maybe you are right, the two behavior cannot affect each other.

blackhornet wrote:It's not clear what you would expect to happen. Do the Blobs stop moving or do they stop the player from moving. The last won't happen as the Pin mechanism is one way. Player affects Blob, but Blob does not affect Player.

I want the Player to stop moving if one of the blob is stuck by the collision on solid elements.
B
44
S
10
G
7
Posts: 183
Reputation: 10,098


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests