|
Hi guys! 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?
(comments are locked)
|
|
Hi! I finally find what make the objects moving slower. It is because of the gravity of Unity. I must do my own gravity and not use the gravity of unity to have the behavior i was expected. Thanks for your help!
(comments are locked)
|
|
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. I tried your solution and it wasn't successful unfortunatly. The plateform is still moving a little bit faster than the objects. But thanks for your attention!
Apr 02 '12 at 07:09 AM
Souss
(comments are locked)
|

Is the container a separate object grouped to the platform and does it also have the same script attached to it?
Those objects are just other which came on the plateform, like for example a simple cube which fall on it. So, those objects don't have any scripts attached on it.
This is the script that added objects into the container which enter on collision with the plateform and suppressed it when objects are not on it.
Do not care about the boolean this.fallen, this is for something else.