Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling physics interpolation on TileMapLayer enables it 4.3.beta1 #93237

Closed
PauliusMM opened this issue Jun 16, 2024 · 2 comments · Fixed by #93279
Closed

Disabling physics interpolation on TileMapLayer enables it 4.3.beta1 #93237

PauliusMM opened this issue Jun 16, 2024 · 2 comments · Fixed by #93279

Comments

@PauliusMM
Copy link

PauliusMM commented Jun 16, 2024

Tested versions

4.3.beta1

System information

Windows 11

Issue description

While testing I saw some weird behavior with TileMapLayer, it seems disabling physics interpolation enables it, what is more weird the TileMapLayer is not even moving, as it is made visible and invisible

test.mp4

Steps to reproduce

Create a project
Enable project wide Physics interpolation
Create a TileMapLayer
Add tileset
Disable TileMapLayer physics interpolation
Try making it visible/invisible

Minimal reproduction project (MRP)

Project for reproducing: new-game-project.zip

@rburing
Copy link
Member

rburing commented Jun 16, 2024

The issue is not present in Godot 3.5.3: new-game-project-3.zip

So I must have made a mistake in porting the feature to 4.x, and/or overlooked some difference between 3.x and 4.x. At first glance I don't find the source of the bug. cc @lawnjelly

@lawnjelly
Copy link
Member

@rburing If physics interpolation is off for the TilemapLayer you need to tell the server this, e.g. when creating the canvas item.

You probably also want to respond to Node::_physics_interpolated_changed() in order to be able to flip this on the fly, but this will do to get started.

// Check if the material or the z_index changed.
if (prev_ci == RID() || prev_material != mat || prev_z_index != tile_z_index) {
	// If so, create a new CanvasItem.
	ci = rs->canvas_item_create();
	...
	if (!is_physics_interpolated_and_enabled()) {
		rs->canvas_item_set_interpolated(ci, false);
	}

I may not do this absolutely correctly in 3.x actually (even though the bug is not seen there), I might check whether that needs tidying up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Bad
Development

Successfully merging a pull request may close this issue.

4 participants