Page 1 of 1

collision problem

PostPosted: Thu 11 Oct 2018, 11:22
by neonfrost
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
Image

then stops at...
Image

also happens when the character goes behind it
Image

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

Image

Image

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

Re: collision problem

PostPosted: Thu 11 Oct 2018, 12:23
by Lizard-13
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 :)

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.

Re: collision problem

PostPosted: Fri 12 Oct 2018, 01:28
by neonfrost
Lizard-13 wrote: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 :)

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 :(

Image

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"

Re: collision problem

PostPosted: Fri 12 Oct 2018, 12:44
by Lizard-13
It should be:
Code: Select allConditions: Destructible is in collision with MyObjectToFollow
Actions: Separate MyObjectToFollow from Destructible (only MyObjectToFollow will move)

Assuming MyObjectToFollow is the small rectangle :)

Re: collision problem

PostPosted: Sat 13 Oct 2018, 00:59
by neonfrost
Lizard-13 wrote:It should be:
Code: Select allConditions: Destructible is in collision with MyObjectToFollow
Actions: Separate MyObjectToFollow from Destructible (only MyObjectToFollow will move)

Assuming MyObjectToFollow is the small rectangle :)


oh no :D Myobjecttofollow is the character dragon thing ....the rectangle is "NewObject" sorry for the confusion there

Re: collision problem

PostPosted: Sat 13 Oct 2018, 04:13
by Lizard-13
Then the other way:
Code: Select allConditions: Destructible is in collision with NewObject
Actions: Separate NewObject from Destructible (only NewObject will move)

(there is an action to separate objects) :)