- Home /
Automatically rotating objects to fit on to others
Okay, so this is hard to explain so i uploaded a video in youtube to attempt to explain this more. So the main idea is i am making a game where you can build a car to drive, and you see me placing some stuff and when i hover over a block when i am placing a wheel it currently only moves its transform.position to the cube, but i want to automatically rotate the wheel into its correct rotation. You see me rotating it manually in the video into the rotation i would like it, and please ignore the gap between the wheel and cube as i will be fixing that after this. I am not looking for code to make this work, i just want to know how i should go about doing this. I think there is probable a way to do it using the RaycastHit.normal, but i am not sure how.
This is the link to the video : https://www.youtube.com/watch?v=tY6BXbsUpS0
Your answer
Follow this Question
Related Questions
Cant understand why object rotates when setting transform.up to normal 2 Answers
default cylinder to indicate hit.normal 1 Answer
Rotating to match normal: Quaternion.FromToRotation(player.up, hit.normal) 1 Answer
Why does the raycast hit only objects/faces of a certain rotation? 1 Answer
Distribute terrain in zones 3 Answers