I can make a moving platform with an AnimatableBody2d very simply in my level (simple platformer to learn), and it works smoothly if I put it by hand for each platform. But as soon as I make a scene with a moving platform, it doesn’t show when I add it.
I don’t get it.
Edit: If I delete my AnimationPlayer node, the platform appear in my level scene, I’m more confused.
Could you share your code with us? The problem could be anything. My best guess is that you’re instantiating a scene, but you’re not actually adding it to the scene tree. But this is a wild guess because I haven’t seen your code.
I have a scene like this:
AnimatableBody2d
-TileMapLayer (my platform sprite is in it)
-CollisionShape2d
-AnimationPlayer (with a animation that make the platform move 300px to the right)
and my level is:
Level1
-ParallaxBG
-TileMapLayer (for the floor layer)
-Platform (the scene above)
The only thing in the code of the level is the player spawn.
Could it be that your AnimationPlayer node is the one that controls the movement of your platform? If that’s the case, placing it in another map might completely mess with the Position variables that your AnimationPlayer is using, as the Position of the platform might be different on different maps, and the AnimationPlayer always has a fixed position value set.