Ignore Sprites with solid behavior

Get help using Construct 2

Post » Mon Feb 09, 2015 7:16 pm

Hello, everybody.

I have a character with the behavior "8-directions" and another Sprite with "solid" behavior.

How do I ignore my character that object, that is going through it normally?

:roll:
B
16
S
1
Posts: 89
Reputation: 1,234

Post » Mon Feb 09, 2015 7:21 pm

@derikvlog, why would you have solid behavior on the object if you did not want solid behavior?

You can turn it off dynamically, but it sounds like you need more than one sprite. Ones that you can move through (no solid behavior) and ones you can't (solid behavior).

If you really do want to ignore solid behavior temporarily you can alter the state, on the collision or some other event.

Solid actions
Set enabled
Enable or disable Solid for this object. Be careful not to trap objects by enabling the solid when an object is overlapping it; see Avoid crushing/trapping objects with Solids.

https://www.scirra.com/manual/104/solid
B
21
S
4
G
1
Posts: 96
Reputation: 1,872

Post » Mon Feb 09, 2015 10:16 pm

MrGoatsnake wrote:@derikvlog, why would you have solid behavior on the object if you did not want solid behavior?


He could want the solids to only affect certain objects, not all of them.
B
18
S
6
G
4
Posts: 224
Reputation: 3,281

Post » Mon Feb 09, 2015 10:18 pm

@derikvlog u can disable the collision with that object .. with physics i think
B
70
S
20
G
67
Posts: 1,311
Reputation: 42,284

Post » Tue Feb 10, 2015 1:30 am

MrGoatsnake wrote:@derikvlog, why would you have solid behavior on the object if you did not want solid behavior?

You can turn it off dynamically, but it sounds like you need more than one sprite. Ones that you can move through (no solid behavior) and ones you can't (solid behavior).

If you really do want to ignore solid behavior temporarily you can alter the state, on the collision or some other event.

Solid actions
Set enabled
Enable or disable Solid for this object. Be careful not to trap objects by enabling the solid when an object is overlapping it; see Avoid crushing/trapping objects with Solids.

https://www.scirra.com/manual/104/solid


Man, this behavior I know use. The problem is ...

I'm making a game where the enemies are walking from one side to another, within a "fence". Play more need to go through that fence.

PS: I want only the enemies collide with the fence (solid behavior), the PLAY pass by it normal.
B
16
S
1
Posts: 89
Reputation: 1,234

Post » Tue Feb 10, 2015 5:38 pm

@Hasuak, right. Still yet it would probably be better to not have a solid at all, then have the Enemies' behavior change when overlapping. turn around, stop, etc.

This is a problem where you have to decide if it is the sprite's behavior you are wanting to change dynamically, or the behavior of the objects interacting with the sprite. Rather than have the sprite try to accommodate all actions of external objects, have the external objects handle how they interact with the block.
B
21
S
4
G
1
Posts: 96
Reputation: 1,872

Post » Tue Feb 10, 2015 9:59 pm

You could give the enemies another object on top of them and make it a physics object. Use Pin behavior to stick the object on top of the enemy. Then make the fence also an immovable physics object. Physics objects don't collide with objects with Solid behavior so you can keep using Solid for player without a problem of colliding with either the fence or the enemies.
B
18
S
6
G
4
Posts: 224
Reputation: 3,281

Post » Wed Feb 11, 2015 1:52 am

Hasuak wrote:You could give the enemies another object on top of them and make it a physics object. Use Pin behavior to stick the object on top of the enemy. Then make the fence also an immovable physics object. Physics objects don't collide with objects with Solid behavior so you can keep using Solid for player without a problem of colliding with either the fence or the enemies.


I recorded a video showing what happens, I tried to do it the way you told me ... more did not work, what I did wrong with the physical?

https://www.youtube.com/watch?v=1DmWJ_FwO7w
B
16
S
1
Posts: 89
Reputation: 1,234


Return to How do I....?

Who is online

Users browsing this forum: Darknessed, ismael123 and 10 guests