# Collision between layers

For questions about using Classic.

### » Sat Dec 17, 2011 5:33 pm

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?
TheChosenOneARTS2011-12-17 17:36:34
B
1
G
1
Posts: 4
Reputation: 433

### » Sat Dec 17, 2011 5:49 pm

Maybe check, if they are overlapping? Or you need a real collision?
B
24
S
9
G
2
Posts: 294
Reputation: 3,160

### » Sat Dec 17, 2011 7:26 pm

If I use overlapping - it works only at the place, where it would be if scroll ratio = 100%
B
1
G
1
Posts: 4
Reputation: 433

### » Sat Dec 17, 2011 7:59 pm

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?
B
24
S
9
G
2
Posts: 294
Reputation: 3,160

### » Sun Dec 18, 2011 10:28 am

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.
B
1
G
1
Posts: 4
Reputation: 433

### » Sun Dec 18, 2011 11:41 am

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 .
I'm pretty sure they will answer.
B
24
S
9
G
2
Posts: 294
Reputation: 3,160

### » Mon Dec 19, 2011 12:12 am

B
94
S
33
G
113
Posts: 5,353
Reputation: 73,267

### » Mon Dec 19, 2011 4:25 pm

emm... Its construct 2 cap
I need it for Classic :D
Can you please make it?
B
1
G
1
Posts: 4
Reputation: 433

### » Mon Dec 19, 2011 7:42 pm

For CC it would look like this:

[code]+ Sun: overlaps player : offset
(ScrollXLeft*(100-LayerScrollRateX(.Layer))/100,
ScrollYTop*(100-LayerScrollRateY(.Layer))/100)
-> Text: Set text to "true"
[/code]
B
94
S
33
G
113
Posts: 5,353
Reputation: 73,267

### » Mon Dec 19, 2011 8:16 pm

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
Could be usefull in combination with the sunrays example, which someone posted earlier.zyblade2011-12-19 20:18:50
B
24
S
9
G
2
Posts: 294
Reputation: 3,160

Next

Return to Help & Support using Construct Classic

### Who is online

Users browsing this forum: No registered users and 1 guest