How do I prevent an object to pass through another object.

Get help using Construct 2

Post » Wed Jul 22, 2015 12:47 pm

Hi Guys,

I have two objects in my game. A ball and a vertical line. The ball has Custom movement and Solid behaviors. The line has a solid behavior. Now when I try to pass the ball through the line, it shouldn't pass. How can I achieve this.
I tried giving Physics behavior to the line and made it immovable, but still the ball is passing.

Any help much appreciated.

Thanks.
B
8
S
1
Posts: 40
Reputation: 868

Post » Wed Jul 22, 2015 12:50 pm

The custom movement behaviour has the "push out solid" action..
That action should get you the results you want..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Jul 22, 2015 1:05 pm

Hi,

Thanks for the reply.
My understanding of "Push out solid" action is that upon collision with the line, it would push the ball to some direction based on our selection. Does it block the object?

Also I wrote an event line --if the ball collides with the line---> "push custom movement out of solid in opposite direction" on the ball.

This too doesn't seem to do anything. I can still pass the ball through the line.
Can you help me if I am writing the event wrong.

Thanks and Regards.
B
8
S
1
Posts: 40
Reputation: 868

Post » Wed Jul 22, 2015 1:13 pm

It's been a while since I've used it, but if I remember correctly, using is overlapping instead of on collision would help..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Jul 22, 2015 3:28 pm

Thanks for the reply. I tried to "STOP" the ball on "Overlapping with other object" but it still is not giving the desired functionality according to my game. I will do a few tweaks hear and there to see if I get my desired result.

Meanwhile if any one knows how to achieve it, please do help me. I got struck at this point.
What I want is to achieve how an object would get blocked when it has 8 direction behavior, but with custom movement.

Thanks.
B
8
S
1
Posts: 40
Reputation: 868

Post » Thu Jul 23, 2015 11:40 am

Ok..I got one way of doing it..on collision I can write an event to move the ball in opposite direction 2px.


I'm loving Construct 2.
B
8
S
1
Posts: 40
Reputation: 868


Return to How do I....?

Who is online

Users browsing this forum: jaytrott86 and 7 guests