I have a little problem with my script which consists to make a kind of plateform.
This script allows an object to move (like Sinusoïdal behavior, or Linear...), and if another object comes on this one, it will have exactly the same movement.
Here is the script which makes the plateform and objects on this one moving Linearly :
this.sens represents the direction of the plateform movement (-1 or 1), this.speed the speed of the plateform and this.objOnPlateForme the container which contains the objects.
The problem is that the object of the container doesn't move exactly like the plateform. I don't really understand because the value of X and Y are exactly the same, but the objects on it move little bit slower than the plateform.
Do any one know an issue?
A possible workaround could be to store the difference the platform travels between each tick and offset each object by the distance traveled. It's just an idea I haven't tried it sorry.