Hello, like other users, I am encountering a significant issue with parallax: objects on different layers cannot collide because their position appears to be different from what it seems.
It’s a common problem that everyone has solved by eliminating parallax (making the games much less professional). Here is a list of some users who have encountered this issue:
Hello here is my problem of the day, I have an element on my background which must be in collision with my ship but as there is a parallax effect in my game and the object to touch must follow the background then the collision does not is not done or else is done very to the left of my object. A solution for me please? THANKS.
Here the screen :
In a game, I am using different layer each with its camera setting (parallax). And I’d love to check collisions between objects in different layers : do something when these objects collide on the screen.
However present system, for collision, checks the object’s position in their respective layers, and not what we see on the screen.
Hence the idea to get Screen coord and Screen collisions !
Would it be useful for anyone else ?
Apologies if I’m just missing something obvious, but I have this issue in my scene where it appears as though all of the collisions of objects with platform behaviour are shifted to the left. This issue is present whether I’m in fullscreen or normal view.
You can see the separate collisions here:
And when the player moves into it I expect the player not to be able to move, but instead they go into the platform corner’s collision:
I also have the same issue the other way whe…
The solution is simple: a checkbox in the “advanced options” of the sprite, where it asks to use the collision of what is seen on screen and not the real mathematical coordinates.
This problem concerns not only platformers but also puzzle games and visual novels (as in my case).
It’s a good idea. I’m wondering that since it’s tied to collisions a better place for a toggle might be the collision condition or maybe a separate condition. That way you’d still have the option to ignore collisions between layers (out of sync cameras) if needed. You also wouldn’t need to change the setting for every object. Especially since the setting screen is different for each object type.
I think it would be easier to modify 1 condition instead of all of the object types.
It seems to me a great idea. I had thought of a command called Overlap, similar to Collision, but that specifically ignores parallax. However, I fear it would take more time to implement.
These are users who have the same problem. I am looking for others to find a temporary solution in the meantime.
I’m a bit confused because I’m getting used to moving the camera.
I have noticed that if an object on a layer that is moved by the camera collides with another object on a layer that is not moved by the camera, the collision does not work.
Example: Let’s say it’s a side-scrolling platform game and there is no scroll to go back and there is a wall marking the left edge of the screen. I put that wall on a layer that doesn’t move the camera, this way even if i move the character then the wall alw…
When you rotate the layer camera, you’re doing just that - rotating the layer camera - and not rotating the scene. It just rotates the view of the layers. In this case, you’re rotating what gets sent to the screen by 90 degrees in a clockwise direction. So when you’re moving the red square from right to left on the screen, it’s movement is really rotated by 90 degrees anti-clockwise, and it’s really moving it down the scene.
To understand this better, add a third object above the red one, and s…
I recorded a video to show what’s happening when I run the Vertical Slice. Debugging is enabled and if that looks confusing, I can take another video without the debugging and collisions shown.
Do collisions only work if they’re on the same layer? I’m asking because BookSprite is on the GUI layer and Locked in on a different layer. I don’t think I could put them on the same layer, though
I have a problem with the collider condition: I need to detect the object collider for two different layer objects. If I put them on the same layer I haven’t any problem but I need to put them on different layers and sometimes it works, sometime not.
Any idea ? I’m thinking to write something like:
“f position of object A is about position of object B” but I’m not able to write it.
I tried searching, but didn’t find anything suitable.
I’m using the Physics Racing game template and added an opponent. Problem is, I don’t want them colliding with the player, like they are on different lanes/layers, but still collide with the platforms and other level objects.
(It would also be nice if the collisions could still be “detected” when the player is over an opponent for adding future features.)
As for my problem, I have six layers with different parallax and zoom. Calculating the impacts is really very difficult.
Then I make a consideration: if instead of collisions, touch is used on an object, this works regardless of the camera. Isn’t that contradictory? I should have different coordinates on each layer where the tap happens