That’s a pretty good idea. I’ll give it a shot. I actually did the opposite and made collision around the props but I feel like your idea would tidy up the level a bit and require less work.
One thing I’m wondering before I go about jumping into your method, would I be forced to make a blueprint for every prop or could I just drop sprites and set a custom object type, and set the player collision to only hit that object type. From there, try to manipulate said object types in array. I’m not 100% sure how difficult that will be.
I have an idea of how I would make the blueprint. Once a prop enters camera view the math below would run on a tick.
float ParallaxSpeed = 0.1; //higher values = more movement. I would use a static value for testing but ideally the value of this float would vary depending on the Z axis of the prop.
A = (PlayerXLocation - LastPlayerXLocation) * ParallaxSpeed;
B = (PropXLocation - A);
LastPlayerXLocation = PlayerXLocation;
//when player leaves prop vicinity set LastPlayerXLocation to 0
Adjust the prop to the new X and viola!
It works when moving both left and right. When moving Left to Right A is a positive value, which causes the prop to move left when subtracting A from it’s own X; the ideal effect for parallax.
When moving Right to Left A returns a negative value causing the prop to move right when you subtract.
Not yet tested but it seems pretty sound in my head.