I have a moving platform and boxes falling on said platform.
The problem is that the boxes don’t move with the platform, instead, the platform moves under the boxes.
How can I fix this? And I don’t want them to become part of the parent class, because I want the boxes to be able to still fall off(and move around) if too much gets piled up.
HELP! Thanks.

Bump? Please help me out.
Add a rigidbody and a box collider to your boxes. Add a box collider to your moving platform.
No that’s not the problem. They sit on the platform just fine, but when you try to move the platform…the sit still.
Have you tried turning up the friction on the rigidbodies? Setting them to the maximum (or ridiculously high) in order for them to stick? Cause it sounds like the boxes are sliding (kinda like the trick where you’re pulling the table cloth fast enough where the plates ontop don’t move)
I tried that…and sadly it just makes any object on it bounce around like crazy when the platform moves…no idea why…
Please help me out!
Alright then,…
How would I make the boxes part of the platform parent class when it collides? I didn’t really wanna do it this way…but I guess since no one knows…
make a script that when OnCollisionEnter, if it collides with your platform (have a tag called platform on it and check the tag) that it becomes parented to the platform.
I’ll give this a try, what’s your setup? Does the platform have a rigidbody? How are you moving it?
The platform does have a rigidbody…I am moving the platform via Accelerometer (iPhone).
I have tried:
Friction values (made the boxes all jumpy and crazy)
Upping the Mass (nothing different)
Both at same time (crazy jumpy and still doesn’t even flow with the platform…)
The platform isn’t twitching and crazy…it can only move on the X axis via Accelerometer which is moving perfectly.
Mmkay, so I just did a little test, and it should move with the platform. I very rarely use the built in physics for anything, so this is new to me too.
I have a scene made with two objects. One of them is a box scaled 4 on the width and length, and one is a box scaled 1:1:1. The smaller box is placed about 3 units above the big box. The small box’s mass is 0.2, the rest of the rigidbody settings are default.
The larger box has Use Gravity off, and Freeze Rotation on. It’s mass is 1.0.
Also, it has this script attached:
function Start()
{
rigidbody.AddForce(transform.forward * 1000.0);
}
And that’s all. Place the camera for optimal viewing, and press play.
If I had to guess at what you’re doing wrong, you’re probably move the platform directly through the transform. Something along the lines of
transform.position.x += 10.0 * Time.deltaTime;
This unfortunatly doesn’t work. For a physics engine to function properly, it needs to know information like the vector of an object…while it may look like the object is smoothly floating to us, it’s really just teleporting forward a small amount each time.
Side note: should forces always be such huge numbers? Again, I never really use the physics engine.
Second side note: super excited for Unity 3 character controller updates…can’t wait to make crazy moving levels like trains and stuff.
I apologize I don’t have the ability to set up an Iphone example.
Tried this real quick, made a plane put a rigidbody on it, gave it a mass of 1000. Had a cube with a rigidbody on it drop onto it and then addForce to the platform to the right.
The cube stayed on just fine. The only thing I can say is take a look at the Accelerometer and how you are moving the platform.
You may need to take that information and throw it into AddForce() or another function
I’m still new and figuring things out as well.
Thanks a bunch I’ll give this a try in a few and return with the results!
Everything works now! Thanks a bumch man.