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

Moving platform with tilemap does not working properly #35550

Closed
Tracked by #45334
fabriceci opened this issue Jan 25, 2020 · 7 comments
Closed
Tracked by #45334

Moving platform with tilemap does not working properly #35550

fabriceci opened this issue Jan 25, 2020 · 7 comments

Comments

@fabriceci
Copy link
Contributor

fabriceci commented Jan 25, 2020

**Godot version:**
OS/device including version:
3.1 & 3.2 - MAC/WIN

Issue description:
movingTilemap.zip

Similar to what happened with a KinematicBody2D on a platform before 3.1, there are issues when the platform has a Tilemap (as collisions):

  • vertical movement : the body "enter" in the platform
  • horizontal movement: the body move with the horizontal movement

screenshot

I tried different setup in the demo project, but nothing works.

  • Setup1: Kinematic Parent with sync to physic, static Tilemap => vertical movement seems ok
  • Setup3: Node2D Parent, static Tilemap => not working
  • Setup2: Node2D Parent, Tilemap with kinematic collision => not working
  • Setup4: Kinematic Parent, Tilemap with parent collision => not working with movements
    • vertical: when the platform goes up, you can't move
    • horizontal: you are accelerated/decelerated according the platform movement.

Edit: My assumption is, it should work with "use parent" on the tilemap (but I'm not sure)

@fire fire changed the title Moving plateform with tilemap does not working properly Moving platform with tilemap does not working properly Jan 25, 2020
@madmiraal
Copy link
Contributor

It's unclear to me what the issue is. What do you mean by "not working"? What is the current behaviour? What is the expected behaviour?

If there are multiple issues, you should close this issue and create a separate issue for each problem, together with a minimal reproduction project clearly demonstrating that one problem. Also, you should upload images, example projects, etc. directly to Github instead of using links to external storage providers.

@fabriceci
Copy link
Contributor Author

fabriceci commented May 24, 2020

It's unclear to me what the issue is. What do you mean by "not working"? What is the current behaviour? What is the expected behaviour?

If you want a body follows (without moving) properly a platform in 3.1, you need to check the "sync to physics" box. But like in KinematicBody3D, there is not "sync to physics" checkbox on Tilemap, so I tried different setups.

If this is the Godot's proper way to deal with moving plateform, maybe the issue should be renamed "Add sync to physics checkbox to Tilemap/GridMap" [edit: it's a possible solution but the existing "use parent" should be enough.]

@madmiraal
Copy link
Contributor

Add sync to physics checkbox to Tilemap/GridMap

That would make this a feature request and not a bug. Feature requests should be made here.

@bojidar-bg
Copy link
Contributor

You can probably use some StaticBody2D/KinematicBody2D with sync to physics, then put the TileMap as a child and turn on "use parent" for collisions. I'm afraid there isn't a similar workaround for GridMaps, however.

@fabriceci
Copy link
Contributor Author

fabriceci commented May 25, 2020

That would make this a feature request and not a bug.

I do not agree, that's a possible solution not a new feature. Furthermore, I forgot the existence of the "use parent" checkbox used in the setup n°4, this option should act like the parent (KinematicBody2D with sync to physics), but it doesn't.

If I'm wrong, feel free to close the issue.

You can probably use s...

@bojidar-bg It's already tested in my setup n ° 4

The workaround I found is to actually not use the _physics_process function for kinematic bodies, but instead keep them in a list in the scene node, and "update" them in the right order. In case of a collision with the platform apply the platform velocity to the player. It's working but it's restrictive / heavy.

@pwnorbitals
Copy link

According to my understanding the setups 2 and 4 should work.

setup 4: physics issue?
setup 2 : I think the Tilemap needs the motion parameter: sync to physic (in kinematic mode).

This sounds like two different issues, one being a feature request

@fabriceci
Copy link
Contributor Author

@pwnorbitals I think it is not necessary to have a sync to physics after all, because there is already a "use parent" checkbox.

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

No branches or pull requests

5 participants