How do I Get collisions working with 8 direction movement

Just started using Construct 2? Post your questions here

Post » Mon Aug 21, 2017 4:18 am

So I have collisions "working" somewhat but my character doesn't always collide perfectly. Sometimes when I walk into a wall, he stops with a slight gap between him and the wall and sometimes he collides fully against it. I'm trying to get him to always collide fully against it. Here's my project file, so far I'm just trying to get movement exactly as I have shown here with collisions working perfectly. Project File
B
6
S
2
G
2
Posts: 19
Reputation: 1,663

Post » Mon Aug 21, 2017 11:00 am

Ditch the set position every tick logic and use pin player anim to player, I see it already has the pin behaviour but you're not using it. Should be colliding without a gap now.
B
46
S
16
G
79
Posts: 2,170
Reputation: 46,857

Post » Mon Aug 21, 2017 9:19 pm

When I do that, my character rotates with the 8 direction object. I want that object to rotate to keep track of my angle but I don't want the player animation to rotate. Shouldn't the every tick set position method work the same way though?
B
6
S
2
G
2
Posts: 19
Reputation: 1,663

Post » Tue Aug 22, 2017 8:33 am

On the pin event you select pin (position only) instead of the default pin (position and angle). With the every tick set position method there is some logic that is constantly altering its x or y by some pixels, that seems a bit untidy and may cause unexpected results such as being a few pixels away from the object collided with.
B
46
S
16
G
79
Posts: 2,170
Reputation: 46,857

Post » Tue Aug 22, 2017 6:09 pm

So I tried that and the pinning works fine and everything, but I still get the same issue. Here's my current project file Project File

So if you walk straight down into the bottom and then walk diagonally in directions it'll sometimes collide with a gap and sometimes no gap.
B
6
S
2
G
2
Posts: 19
Reputation: 1,663


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest