Issues with "Move To"
NexusGameStudio
Member Posts: 265
So I'm using the "move to" behavior to control a camera on my menu system, everything works perfectly, however, the "move to" rule seems to be rather broken (I see others have the same view considering the forum posts about this rule). The camera will sometimes miss its coordinates in which its supposed to move to by slightly moving beyond it or sometimes it just keeps moving without stopping.
My only fix right now (and its still kinda iffy) is I added a timer in which it has the exact timing of the distance between menu A and menu B, after X amount of seconds, it constrains the X or Y coordinates to its final position, that way if it goes beyond, it just snaps back. I have also added a rule to the camera actor where if it passes a certain coordinate, it destroys itself. Again, its not perfect, but it works for now...somewhat, better than without it.
My question is, do any of you fine folk have any ideas to make this rule work correctly, or perhaps another concepts to move my camera to the correct coordinates perfectly?
My only fix right now (and its still kinda iffy) is I added a timer in which it has the exact timing of the distance between menu A and menu B, after X amount of seconds, it constrains the X or Y coordinates to its final position, that way if it goes beyond, it just snaps back. I have also added a rule to the camera actor where if it passes a certain coordinate, it destroys itself. Again, its not perfect, but it works for now...somewhat, better than without it.
My question is, do any of you fine folk have any ideas to make this rule work correctly, or perhaps another concepts to move my camera to the correct coordinates perfectly?
Comments
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Edit: QS beat me to it
didn't think to use interpolate (i.e. interpolate the position values to the destination point positions over a specified amount of time), but that seems like a good idea, but not sure which way would give better code efficiency, interpolating the position values.... or changing the linear velocity values and then testing for when the position reaches destination and changing velocity values again to stop/change direction of movement.
My camera was working on preview, but not on iphone (it was scrolling all the way to the left instead of stopping where it had to). I'm currently building it updated. I'll let you know if interpolate solved.