godotengine / godotengine/godot
When Camera is enabled, the ParallaxLayer/Tilemap Physics Layer is calculated inaccurately using is_on_floor()
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
v4.3.dev3.official [36e943b6b]
### System information
Linux Kubuntu 23.04 KDE Plasma Version: 5.27.4 KDE Frameworks Version: 5.104.0 Qt Version: 5.15.8
### Issue description
The `is_floor()` function reports incorrectly (or is off) when being applied to a ParallaxLayer Tilemap and a Player with Camera enabled. If camera is disabled, then is_floor() works correctly.
### Steps to reproduce
Create a CharacterBody2D Player with a camera. Also create a ParallaxLayer and a TileMap floor with a physics layer collider. When the Player drops to the floor it will not stop at the floor but somewhere else depending on the ParalaxLayers position.
Project

Camera Enabled

Camera Disabled

### Minimal reproduction project (MRP)
[Archive.zip](https://github.com/godotengine/godot/files/14391638/Archive.zip)
Contributor guide
Research direction
Start with the attached Archive.zip minimal reproduction and compare the CharacterBody2D, Camera, ParallaxLayer, and TileMap physics-layer behavior with the camera enabled and disabled. Trace how floor detection is calculated in this setup; done means the player stops at the TileMap floor consistently regardless of the ParallaxLayer position and is_on_floor() reports correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100