# Move to point Parallax problem

• 13th June 2019, 01:01 PM
Outcast
Move to point Parallax problem
I made a thread a while ago about making a bird AI and I have the bird moving now to a spot on a tree. It worked fine, however once I put it on a layer with a parallaxing coefficient it got messed up and the bird no longer goes to the spot it is supposed to, but stops long before it (it happens about 90% of the time and everything is on a single layer)

Do anyone know how to fix this? I have uploaded an example where you can move the camera with the S and D keys to see the point the bird is supposed to land on and how he does not fly to the correct spot. If I change the layer back to a coefficient of 1.0 everything works as it should.
• 14th June 2019, 11:47 AM
Outcast
6 people have viewed it but no one have any idea what can be wrong? :/
• 14th June 2019, 03:19 PM
Volnaiskra
I have spent a lot of time trying to figure out the ins and outs of parallax. Like seriously, a lot. I'm talking days or weeks at a time, on and off over the past few years. I still can't get my head fully around it. Even though it seems on the surface like it should be very straight forward. It's basically become my White Whale at this point.

I'm no math wiz by any stretch of the imagination, so it certainly doesn't mean that the solution isn't within easy reach of a more mathematicallly competent mind than my own. But I do think the subject is more opaque than most people would initially assume.

There's another thread about parallaxing somewhere where I posted some equations I came up with to help neutralise camera movements when calculating the x position of parallaxed objects. Perhaps they'll help.
• 14th June 2019, 08:59 PM
Julian82
Same here, I've never found a real solution to this issue. What I do as a workaround is calculating everything based dummy objects placed on a reference layer that has a 1.0 coefficient.
So for example if you've an object on a layer 1 with coeff 0.5 and one on layer 2 with coeff 0.7 and want to compare their X position, create one dummy on each of them, move both dummies to layer 3 (with coeff 1.0) within the same event and grab the dummy coordinates for comparison instead.
This works for very simple tasks but adapting it on multiple objects and a more complex setup like yours seems to be a lot for effort tbh...
• 15th June 2019, 05:30 AM
casleziro
The object's position changes when a parallax happens. This is most likely the cause of your issue. What's compounding the problem is that you're using the easing object: you're stuck in a path that goes from your bird's original position to the tree's position when the easing started. It doesn't account for the change in position by the parallax (and you can't change the path dynamically using the easing object since it's based on a T value afaik).

I don't know much about correcting this myself. Hopefully someone knowledgeable drops in to help get it sorted.
• 17th June 2019, 12:06 PM
Outcast
Quote:

Originally Posted by Julian82
Same here, I've never found a real solution to this issue. What I do as a workaround is calculating everything based dummy objects placed on a reference layer that has a 1.0 coefficient.
So for example if you've an object on a layer 1 with coeff 0.5 and one on layer 2 with coeff 0.7 and want to compare their X position, create one dummy on each of them, move both dummies to layer 3 (with coeff 1.0) within the same event and grab the dummy coordinates for comparison instead.
This works for very simple tasks but adapting it on multiple objects and a more complex setup like yours seems to be a lot for effort tbh...

Hmm, would this work with the easing object also?
• 17th June 2019, 01:57 PM
Julian82
Quote:

Originally Posted by Outcast
Hmm, would this work with the easing object also?

I really can't tell, never used this object. In theory I kind of think yes, but the pairing routine to make sure it grabs the right values for each bird seems pretty complex to set up :/
• 17th June 2019, 02:11 PM
Outcast
Quote:

Originally Posted by Julian82
I really can't tell, never used this object. In theory I kind of think yes, but the pairing routine to make sure it grabs the right values for each bird seems pretty complex to set up :/

But I could understand if things got messy if things where on different layers with different parallaxes, but what I don't understand is why it gets like this when everything and all objets are on the same layer?
• 17th June 2019, 03:34 PM
Julian82
Quote:

Originally Posted by Outcast
But I could understand if things got messy if things where on different layers with different parallaxes, but what I don't understand is why it gets like this when everything and all objets are on the same layer?

Yes, you're right, simple comparisons should work if everybody is on the same party, but I've no idea about the easing object, my guess is that the issue in your example lies within its inner workings.