# Creating a "sticky" joint on two moving objects

Hi there. I got a small issue “sticking” my game objects.

I created a flat surface (circle) that should be the base of my scene. The “speciality” is that this ground isn’t fixed but is itself sitting on a pillar and should be able to rotate. So far so good. Now on this surface I have another GameObject I want the player to be able to move. (velocity + rotation)

Now my problem is that I want that game object to “stick” to the surface while still be able to move it around. So I want to be able to move the object relative to the surface but not in height. Because the surface is moving itself I cannot simply lock the Y-Axis to achieve this.

Because this is way harder to explan than to show there is a little Video. (instead of the car bouncing it should stick to the surface at all time)

As you can see the vehicle “bounces” and I can even fly up into space at some degree which I do not want. All four wheels should always be in contact with the platform.

I tried chracter joint as well as Hinge Joint. with no good results.

Thanks for helping me with this

How about a “Smoke and Mirrors” approach?

• Instead of rotating the platform, rotate the camera the inverse direction so that it only appears as though the platform is rotating (it is actually static)
• At the same time, change gravity so that it is going “down” according to the perspective of the camera. Physics.gravity = -transform.up * GravityConstant (9.81f?) on the camera

This way you won’t get “swinging” forces from the platform rotating.

1 Like

Thanks for your reply. The only problem is: I do not really rotate the platform (programmatically). It itself has a mass and simply should react to the weight (the car and other objects) on it and so reacts to the gravity of the world. (like a balancing board)

You may measure the motion at the point where each object is located and then apply that motion (position + rotation) to their Transform. Modifying the Transform means “teleporting” the objects without affecting the physics. Note that you may encounter some issues to resolve (synchronizing Transforms, interpolation).

1 Like