#Question

1 messages · Page 1 of 1 (latest)

tough spear
#

How to change the collision depending on the player animation being played?

wet jacinth
#

In what way do you want to change the collision?

tough spear
# wet jacinth In what way do you want to change the collision?

I want to add two collisions to the player: one for one obstacle, one for another. I connected the first collision to the player node, and the second to the area node, but the one in the area node does not work, although I set the mask and layer correctly

wet jacinth
#

As in, the area isn't detecting anything? Areas aren't meant for collision - they're meant for detection. They have no solid form.

tough spear
#

yes, it doesn't define it. Should there be an animation during a collision

#

Perhaps you know of some video tutorial or article on the topic: how to make more than two collisions for a player? I didn't find this. I'll be grateful

wet jacinth
#

If you want to have the player have two collision shapes, you can just add two collision shapes as children of the player.

#

If you want to swap which one is active, you can set the disabled property of the collision shapes to make it so that one is enabled and the other isn't

tough spear
#

I know, but we need to make sure that 1 collision reacts to one obstacle, the second to another, and at the same time that they are sized during the game

wet jacinth
#

As in, you want one shape that only collides with one type of obstacles, and a second that only collides with a different type of obstacles?

#

Sorry, I'm just really struggling to understand what you're saying you want

wet jacinth
#

Collision shapes can't define their own collision layers, so that has to be defined by their parent, meaning that a single body can't have two parts that act differently directly

#

But I believe you could add another body of the same type as a child, perhaps?

#

So that one could have different layers

tough spear
#

I'll try it, thanks for your help

tough spear
#

I figured it out!🥰