You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Small rectangular sprites with the bullet behaviour travelling parallel to solid objects within <5 of pixels are not deflected 180 degrees when colliding with a perpendicular solid object.
Confirm angles of sprite and borders to be orthogonal and there to be a gap between the side borders and adjacent sprites.
Preview layout in debug.
Observe the path of the sprite objects and check angle in debug.
Observed result
The left and right sprites do not rebound 180 degrees to their angle of motion.
Expected result
The sprites should rebound 180 degrees regardless of proximity to the side borders if not colliding with them.
Affected browsers
Chrome: yes
System details
If you see a crash report dialog, please copy and paste it to where it says "PASTE HERE" below. Otherwise please go to Menu -> About -> Platform information and paste that information there instead.
View details
PASTE HERE
The text was updated successfully, but these errors were encountered:
When calculating a bounce, Construct has to calculate the normal of the bounced surface from an arbitrary collection of objects. This is quite a difficult thing to accomplish, and it uses an approximation algorithm which looks at nearby objects. This means the objects very close to the edges take in to account the side barriers when computing the normal of the collision, which causes them to bounce at a different angle. This is the kind of thing which is far too troublesome to ever change, since likely hundreds of existing Construct games already depend on the bounce calculation working the way it does. Even improving the accuracy could cause some other games to start misbehaving. So I don't think it's worth fixing this; it's a minor quirk of the bounce algorithm, most people seem happy with it the way it is, and backwards-incompatible changes can cause borderline revolt amongst users, so closing as won't fix.
I appreciate the explanation for why this is a no fix; that said, I could understand if we're talking about a pixel or two gap resulting in a the angle being off by a few degrees, but there's a clear 4px gap between the bullet and the border resulting in a 45 degree deviation from the expected angle, off flat orthogonal surfaces, which isn't exactly a minor quirk.
I recognise that the hope is many users will import their existing C2 projects over, but doesn't C3 being in beta offer an opportunity to clear up these sort of issues with the behaviours and get them working as expected?
IIRC the tolerance is based on the distance it moved last tick, so actually depends on the speed. This is because it only has two data points when calculating a bounce angle - a known colliding point and a known not colliding point, and it works from there. So the tolerance is probably 10px or so.
Problem description
Small rectangular sprites with the bullet behaviour travelling parallel to solid objects within <5 of pixels are not deflected 180 degrees when colliding with a perpendicular solid object.
Attach a .c3p
https://www.dropbox.com/s/dia9gfn1hm68lna/ballcollision.c3p?dl=0
Steps to reproduce
Observed result
The left and right sprites do not rebound 180 degrees to their angle of motion.
Expected result
The sprites should rebound 180 degrees regardless of proximity to the side borders if not colliding with them.
Affected browsers
System details
If you see a crash report dialog, please copy and paste it to where it says "PASTE HERE" below. Otherwise please go to Menu -> About -> Platform information and paste that information there instead.
View details
PASTE HERE
The text was updated successfully, but these errors were encountered: