collision problem

hello again …im having truble making an object stop a characters movement like in this . Im using the game dungeons and dragons as an example because it does exactly what im trying to do in gdevelop

gets in front of the chest

then stops at…

also happens when the character goes behind it

however wen i try something like this in gdevelop the character can only be stopped at the edges like this.

how can i get the character to stop only after it gets in front or behind the object?

1 Like

Just edit the objects hitboxes, in this kind of game the hitbox used while walking is a small rectangle at the base of the object :slight_smile:

If you need the entire object hitbox for other reasons you’ll need two objects, the “real” object with a full-sized hitbox, and a small base object to walk around.

i tryed this but but then this happens :frowning:

this is the condition and action i used …the gray rectangle on the bottom is the new object and im using its collision mask to stop the character wen it colides with the crate

“destructiblecrate” is in collision with “NewObject”------->move “Myobjecttofollow” away from “destructiblecrate”

It should be:

Conditions: Destructible is in collision with MyObjectToFollow Actions: Separate MyObjectToFollow from Destructible (only MyObjectToFollow will move)
Assuming MyObjectToFollow is the small rectangle :slight_smile:

oh no :smiley: Myobjecttofollow is the character dragon thing …the rectangle is “NewObject” sorry for the confusion there

Then the other way:

Conditions: Destructible is in collision with NewObject Actions: Separate NewObject from Destructible (only NewObject will move)
(there is an action to separate objects) :slight_smile: