I am making a game in vb.net and I need to tell whether the character is colliding with any pictureboxes, when I add the "For Each PictureBox In Me.Controls" to the code it doesn't detect any collisions anymore here's the code :
For Each PictureBox In Me.Controls
If Not Collision(picBox1, PictureBox) Then
walk = 1
tmrWalk.Start()
picBox1.Top -= 5
End If
Next
For some reason adding "For Each PictureBox In Me.Controls" also vastly speeds up the movement speed in that direction.
Collison is from a module, I know that collision works because I have tested it while specifying both the pictureboxes