Page 1 of 1

Newbie Asks: How do you do collision detection. ?

PostPosted: Wed Apr 18, 2012 8:45 pm
by ggesterGamePro99
I saw some Game-editor video but i'm not quite sure.

There's a colider object that you add right?

So, tell me if this is right? I make a character, i make a collider.. Then i parent the collider to the character( Somehow, i don't even know how).. and then that's it?
And i would do the same for all level elements like walls, etc?

And so basically:
1How would you tell the actor to not be unable to move, if he comes up to a wall.
2 and also how would you tell a player to get pushed back if he collides with an enemy OR how to change the character animation to GETHITanimation, if he collides with the enemy and the enemy animations are PUCHanimation.?

Re: Newbie Asks: How do you do collision detection. ?

PostPosted: Wed Apr 18, 2012 9:14 pm
by skydereign
Any normal actor can collide. You don't need to create separate actors to handle collisions. But, if you don't actually want the animation to be the collision region (for instance the player) then you would need to create an actor to act as the player's collision region. To do this create either a filled region, or just a normal actor with a bounding box animation (can just be a solid rectangle). Then parent the player to it (not the colliding actor to the player). This will make the player follow the bounding box. This also means that you must instead of moving the player around, move the bounding box around.

Do you know about collision events and PhysicalResponse? It is covered in the gedt's that come with gE, as well as being present in pretty much any basic platformer game you might download here. Anyway, you add a collision event, and use PhysicalResponse to prevent the actors from moving through each other.