How do I fix a collision issue in 4direction movement?

Get help using Construct 2

Post » Mon Mar 31, 2014 10:36 am

Hello everyone,
I have started recently to use Construct 2 and I' m trying to make a skating like movement but my object collision, with the 4direction behavior, stops randomly a few pixels before solid block. Sorry if I bother you with stupid questions (I'm trying to learn) and also sorry for my poor english.

Here is the .capx
Code: Select all
https://dl.dropboxusercontent.com/u/25317962/skating.capx
B
7
Posts: 5
Reputation: 342

Post » Mon Mar 31, 2014 12:29 pm

Have you checked your collision box in the sprites animation frames, maybe they need adjusting?
B
14
S
6
G
3
Posts: 83
Reputation: 4,218

Post » Mon Mar 31, 2014 2:12 pm

I'm not sure if the problem is only an adjusting.
Theoretically, everything are ok. That should not be happening.
B
7
Posts: 5
Reputation: 342

Post » Mon Mar 31, 2014 5:07 pm

How odd.

Try using the bullet behavior instead and see if it happens.

Have it change the angle of motion depending on which key you press, and stop moving once it hits a wall.
B
83
S
40
G
15
Posts: 993
Reputation: 16,909

Post » Mon Mar 31, 2014 11:15 pm

@justifun, thanks for the advice.
Now my problem is that my player remains stuck on solid blocks and I can't give directions anymore.
Image
I know that I have define to disable bullet behavior when playerBox is on collision with Block but I can't find a way to continue with code.
B
7
Posts: 5
Reputation: 342

Post » Tue Apr 01, 2014 12:36 pm

Is it possible to be a bug? The first one.
Perhaps the right is to report it but I' m afraid if it is my fault.
B
7
Posts: 5
Reputation: 342

Post » Sat Apr 19, 2014 12:03 pm

I'm having the same problem as your original post.
Sometimes the hero will stop right at the solid block, and other times he will stop 1-6(ish) pixels away and refuse to get any closer.

I'm (kinda)trying custom movement right now, and collision detection is giving me a headache. I'd rather if I could just get the 4way direction movement to work properly for me. =(

As for the bullet movement you are trying, I'm not sure if you need to check for collisions, but if you do, disabling the bullet is not what you want to do. That basically turns off the bullet behavior for that object. Instead try setting the speed to 0.
Also, you might(maybe) need to use "Overlapping at offset" to check for collisions before they collide, but that could be totally wrong, I'm still very new to Construct 2.
B
3
Posts: 1
Reputation: 177


Return to How do I....?

Who is online

Users browsing this forum: alextro, stevenode and 6 guests