I have my level on the base layer and a menu as GUI layer.
I want to drag and drop found items from the level in the menu, using the Draggable behavior. And also in the other direction, putting an item out of my backpack into the world.This works fine as long as the level is not moving.
But when I change the camara positon with follow the player or DragCamera extension, it doesn’t work anymore. Sometimes it flickers, jumps and other very broken behavior.
It looks like the menu object’s graphic is still in the right place, but the hitbox is moved with the base layer! I’ve also tried not using 2 layers and keeping the menu on place with the current camara position, but it doesn’t help…
Is there a reasonable solution or trick?
This is really annoying and causes problems in many different game concepts.
I can’t say I really understand how but it works fine, thanks!
Now I have to reach that the items can only be moved into the bar with the mouse and don’t colide automatically when I move the level right-mouse-button-is-not-down in all 3 events works, but when I release the button, the items behind the bar of course will jump into the bar. If you know how let me know, it’s kinda more complicated than anything I’ve done before
Now I have another problem with it.
I don’t want to drag the layer when I drag the item and I don’t want to trigger a button when I drop an item on it.
This only works as long as only one instance of “item” exists.
I have already tried For each object and Pick all objects
Can you set a boolean variable when you are dragging to indicate dragging is in progress? Then when mouse button it released, make sure that boolean variable is false before actioning the button click.
Bc the limits, it can also start outside a button and be on a button (or on another), when released.
I also want to drag the cam when the click starts on a button and ends on an button. But he shouldn’t be pressed because I dragged. The normal behavior in any mobile game with a moving scene, I think.
Maybe I can use a timer, if mouse down and mouse up takes more than 0.5 seconds, it was probably a drag and not a tap. But is also not really reliable.