Hey there , A scrollable layer and a non scrollable layer will only collide normally when the camera origin is X=0 and Y=0 if not , then you will not get a proper precise collision . think about it in a grid terms , the non scrollable items will always stay where they are even if the camera is moving, meaning if your Item is at x=100 even if you move 1000 pixels at any direction , the none scrollable item x value will still stay at 100 , even if you see it on the screen , so don't expect it to collide with an item that is at x=1000 .... i hope you understand what I'm trying to explain here .. Anyway , unless your camera is not moving , i suggest using collide rules only between the same type of layers : Scrollable with scrollable and vice versa ..
if you need it to collide at a certain point of the game , you can tell your hud to spawn an invisible actor to camera.scene.X + self.position.X camera.scene.Y + self.position.Y
I'm having a heck of a time doing the opposite. Trying to drag stuff FROM the nonscrolling HUD layer TO the scrolling gameplay layer. Any ideas on that?
Comments
A scrollable layer and a non scrollable layer will only collide normally when the camera origin is X=0 and Y=0
if not , then you will not get a proper precise collision .
think about it in a grid terms , the non scrollable items will always stay where they are even if the camera is moving, meaning if your Item is at x=100
even if you move 1000 pixels at any direction , the none scrollable item x value will still stay at 100 , even if you see it on the screen , so don't expect it to collide with an item that is at x=1000 .... i hope you understand what I'm trying to explain here ..
Anyway , unless your camera is not moving , i suggest using collide rules only between the same type of layers :
Scrollable with scrollable and vice versa ..
Roy.
Roy.
camera.scene.X + self.position.X
camera.scene.Y + self.position.Y
Then you can register a collision ...
Roy.