I’ll cut to the chase, i’ve been creative on the ways to make it work, but none of them do.
I’m doing a sidescroller runner game and as the sets get instantiated, they get instantly put into a container that moves all the items inside. this helps both having organized hierarchy and just one item carrying the transform.position movements instead of all the children in a per object basis.
The problem is that these objects are moving and the check is done in update method, giving some discrepancies as to what the actual position was → where it will instantiate. Given that the object is moving, a one frame difference when spawning causes a few units of offset which I cannot allow. Why can’t I allow it? because it’s simply not the right choice.
One of the methods was calculating the delay, still shows offset, even though it might be less.
Another method was to calculate the offset given the game speed using the framecount, didn’t work either, because apparently it doesn’t see any difference in frames, meaning it wasn’t actually done in the next frame.
Now I tried another approach, what if I don’t calculate when instantiating itself, but rather when it’s already all parented and then I move the container to the last endpoint (meaning the gizmo that I spawn to see where the set ends onscreen). Hey, I think I got it, nope… there’s still an offset. How is it possible that I have an offset if I’m telling it to move exactly to that position?
Given that right now i’m dry on ideas as to how to make it work, I’ll just put the problem most possible cause: it’s all continuously moving. So what I’m asking is which way would it be appropiate so a transform.position kind of movement does not cause a value offset when I literally tell another object to move to that precise object position.