Collision problems

Non-platform specific questions.

Collision problems

Postby peedalein » Mon Sep 05, 2011 4:38 am

Greetings everyone!

I am having some issues with collision control in GE.


1) A moneybag falls from the sky, the main actor collides with the moneybag. The moneybag
disappears and the the main actor increases the score by one time.

That is the way it is supposed to work and most of the time it works :)
However, when the moneybag collides with the main actor in a certain angle, it keeps
on colliding with the main actor and does not disappear. The score is increased all the time, accordingly.

In the attached file you see the difference. Click on the right GE smiley, the collision works flawlessly.
It increases the score by one time (purple square flying up).

Click on the left GE smiley and it keeps on colliding.

Any ideas how to avoid it?


2) Moneybags and other items fall from the sky. When they reach the ground, the animation is changed to a destroy
animation and the actor is destroyed. If you see the attached file or the screenshot, you notice that the objects do not lie firmly on the ground but they
kind of pass by the ground or hover above the ground.

Any ideas how to avoid this?

Thanks for your help!
Attachments
ISSUE1maincharactercollision.zip
(597.04 KiB) Downloaded 76 times
forumcollision.jpg
ISSUE2forumcollision.zip
(179.62 KiB) Downloaded 71 times
peedalein
 
Posts: 54
Joined: Mon May 17, 2010 2:26 pm
Score: 1 Give a positive score

Re: Collision problems

Postby skydereign » Mon Sep 05, 2011 4:58 am

For your first problem, it actually doesn't happen consistently, but the reason it happens is it collides with the minister, and changes its animation and stops the actor. What you should then do is disable the collision event for the actor. What is happening is the actor stops colliding (the bag shrinks a little in its animation), and then starts colliding again. So, it keeps activating the event. As I mentioned before, one way to fix it is to use an EventDisable.

Now the second problem is partially due to the gold actor's glow. It hovers above the ground, as the collision event actually happens when the glow hits the ground. Now for the other actors, it sounds like you don't like them falling past the ground (I personally like that effect), but you can use this code.
Code: Select all
y=collide.y-collide.height/2-height/2;

This sets the actor's y to right above the ground (you could also use a PhysicalResponse for this). The problem with these are that you should really be using a repeated collision event as your animation's height expands, and with PhysicalResponse, it'd only really work if you had the event repeat. Of course the gold one can't be done this way, as you want their to be a partial overlap so the actual gold part will hit the ground.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Collision problems

Postby peedalein » Tue Sep 06, 2011 12:40 pm

Thanks for the answer. I will try it out.
peedalein
 
Posts: 54
Joined: Mon May 17, 2010 2:26 pm
Score: 1 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest