[SOLVED]Camera layer problem

I’m trying to make a dynamic camera for my game’s inventory. It should behave like this:
2023-06-01 13-09-43_Trim (1)

It’s done with lerp

There’s a problem though, because with this code, the inventory will move with the base layer and it will eventually shift out of view. The inventory UI should not be affected by the players position. The inventory shown is just a single object prototype, and I’d ideally need to be able to construct and inventory out of multiple objects without having to worry about repositioning them later.

Do any you know how could achieve the same effect without changing the position of the inventory in the scene?

You are currently telling it to use the Cursor position based off the base layer. When you do not populate the parameters of the CursorX() expression, it defaults to the base layer.

In general, make sure you fully fill out all expression’s parameters (even if you just want the defaults) otherwise you can run into oddities that you can’t see at a glance.

That isn’t to say this is the only problem leading to what you’re experiencing, but CursorX/Y will need to be updated to point at only the layer the Inventory is on, which in this case would mean CursorX(“Inventory”,0) and the same for Y.

Problem solved! I didn’t know you could specify which cursor to reference.

1 Like