Something Strange with "Is in touch" and solid objets

Get help using Construct 2

Post » Wed Jul 27, 2016 6:35 pm

I don ´t understand what happen :

For my test, I´ve a simple layout with 5/7 objects (simples rectangles 120 width 25 height) and put them in a family with behaviors (solid and physics), I select immovable yes and colisions enabled yes and my player is a circle with behavior physics. Very simple.

And I put a event Touch with "Is a touch" and action for move my player. The player move fine. All correct. I can go up, down, left, right.

But when the event touch is true the player cross over the rectangles (he doesn´t respect they are solid objects) .

When I release button mouse, the player can´t cross the rectangles, physics work, and he respect again condition of object solid.

Seem the player doen´t recognize the solid object(rectangles) when I push my mouse button for active the event, because when I release again the button, The player respect all the "solid" rectangles and I can´t cross over them.

Why? Thanks.
B
5
Posts: 33
Reputation: 299

Post » Wed Jul 27, 2016 7:21 pm

What is the exact event for your player movement? Are you using physics movement or just setting position?
ImageImageImage
B
44
S
26
G
11
Posts: 517
Reputation: 10,500

Post » Thu Jul 28, 2016 4:07 pm

I put this action for player event (Touch>Is in Touch)

a) move forward player.LinearSpd pixels
b )rotate player.RotationSpd degrees toward( Touch.X, Touch.Y)

with instance variable player LinearSpd=3
with instance variable player RotationSpd=6

Player move fine, but like i try explain, he over cross the solid object when I move it, when I release button mouse, the player doen´t cross this solid object (Simple rectangles), It´s very strange. Seem player doesn´t recognize when I move it the solid objects.

Thanks a lot.
B
5
Posts: 33
Reputation: 299

Post » Thu Jul 28, 2016 6:51 pm

I can't remember off the top of my head: is "move player forward" under the physics category? If it's not under the physics category then it won't follow physics rules while acting that out. That seems like the issue you are describing. I only remember physics movements to be apply impulse and apply force
ImageImageImage
B
44
S
26
G
11
Posts: 517
Reputation: 10,500


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests