- Home /
Find mesh top - Keep gameobject on top of a mesh
In the game I'm making I need to make a piston that's composed of 2 parts: a top part and an extending part. As the extending part extends (I used gameObject.transform.localScale += speed) I need the bottom of the top part's mesh to match the top of the mesh of the extending part. In the final product one should be able to see a smooth increase in lenght in the extending part and the top part should look "welded" on top of the extending part. I tried matching the 2 items by translating the top part but it didn't work. What can I do to make this work? Thanks!
Edit: I should specify that the top part and the extending part are bound by a Fixed Joint and the top part is connected my a Configurable Joint to another gameobject
Your answer
Follow this Question
Related Questions
Rigidbody Sink into BoxColider 0 Answers
Moving character on x axis 1 Answer
Gameobject.transform.Translate not working 1 Answer
How can I instantiate and move objects smoothly? 1 Answer
Vector3 Returning Infinity Error 2 Answers