Before Defold 1.6.2 (when new render script was introduced) I needed only to write:
msg.post("go#camera", "acquire_camera_focus")
msg.post("@render:", "use_camera_projection")
And camera would follow the game object where it was attached. Now, the behaviour changed and in the very same project (platformer tutorial), when I post “use_camera_projection” → I get black screen.
When I post only to camera (without posting to render socket) I get behaviour from before - the view is following the camera attached to that go (which I’m moving around with keys - it’s a hero go)
Do you know already what changes in the render script cause this?
The other problem is that when the camera is attached to the game object I’m moving around - there is a noticeable lag:
Apparently, it is not visible on the gif, it’s visible on a real monitor though But you can notice some stuttering when it’s falling down.
On my screen it has visibly two sprites in two different positions (so quick, that it’s probably frame after frame) both when jumping or moving left/right, like, you know, the sprite is “doubled”, changing position really quickly in reference to the camera, or it’s the camera that is doing so in reference to sprite/go.
With the old script I didn’t have such issues
Repro:
To the project: https://github.com/paweljarosz/defold-platformer-tutorial
Add camera to the hero game object, below separate game object (to move the camera):
And add line: msg.post("go#camera", "acquire_camera_focus")
to the hero.script init().