Constrain / Layers Problem
So, I have a simple project (attached) in which two draggable squares are connected by a third line actor. This works as expected provided that the line actor is above the other two actors in the layer. But if you place the line actor at the bottom of the layer, there is a significant lag in the position of the line, as you can see if you drag the actors around quickly.
This is because, as I understand it, actor logic is processed from the bottom up. Therefore, when the line actor is at the bottom of the layer it isn't receiving the other actors' updated positions until the next draw cycle. (I still don't see why this causes so much of a lag considering that there aren't any other actors on the scene. Maybe one of the team members can explain it.)
Obviously, moving the line actor to the bottom of the layer is not a solution if you want the line to appear BEHIND the squares, as I imagine one would in most situations. The only thing I can think to do would be to add an unlocked actor to the scene and use that to relay the positions of the squares to the game attributes, but that would only work if your actors are already on the scene. So, is there a fix for this that doesn't involve extra actors?
Here is the project.
Comments
This is because, as I understand it, actor logic is processed from the bottom up.
Actor logic is processed from the top down.
Layers are processed from the bottom up.
I'd just stick a cap over the top of each actor ?
If the reason you didn't want to use extra actors was because these elements were going spawned (?) then just have the two end points spawn their own caps (set to 'front of layer').
File attached:
@Socks Thanks. I was trying to avoid adding constrained "caps" for performance reasons.
Yeah, I meant the actors within the layers are bottom-up. My bad.
4 extra constrains isn't really going to make much of a difference (I have games with 500+ simultaneous constrains that run fine).
@Socks I know 4 won't, but I may have many of these going at once in addition to other stuff, so it adds up.