# Collision between layers

This forum is currently in read-only mode.
0 favourites
• 10 posts
• I have two layers, one with the ScrollRatioXY=1%, and the other with it 100%.

How do I detect a collision between object "A" on one layer, with object "B" on the other?

• Maybe check, if they are overlapping? Or you need a real collision?

• If I use overlapping - it works only at the place, where it would be if scroll ratio = 100%

<img src="http://piccyo/view3/2371463/89c804e4b3421025a05ac809178233ed/" border="0" />

• Could you explain, why you need to proof the collition that way?

Maybe we find another way to do it, if have further information about your actually goal?

• I want to make something like this: If player overlaps sun -> sun's opacity -1, if not -> +1. BUT Sun is on layer with scroll ratio = 1%, and the player is on layer with scroll ratio = 100%, so it's not working because Construct thinks that player doesn't overlapping it, when it visually does.

• I think it will work somehow with "overlapping at offset", and then puttin in a math formula, that dynamicly correct the difference that causes the scroll ratio. We just need one of the math guys <img src="smileys/smiley36.gif" border="0" align="middle" /> .

I'm pretty sure they will answer.

• emm... Its construct 2 cap

I need it for Classic :D

• For CC it would look like this:

``````+ Sun: overlaps player : offset
(ScrollXLeft*(100-LayerScrollRateX(.Layer))/100,
ScrollYTop*(100-LayerScrollRateY(.Layer))/100)
-> Text: Set text to "true"
``````
• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• Thank you^^ I think I could need it also for another thing. Somehow, I knew, that if I say "math guy" r0j0 comes up with an example <img src="smileys/smiley4.gif" border="0" align="middle" />

Could be usefull in combination with the sunrays example, which someone posted earlier.