- Home /
Copy position from one object to another on one axis
Hi! I'm building simple game where planet is shrinking as car drives on it. (inspired by Brackey game Shrinking Planet) Long story short, main point is to avoid meteor craters. My question is how to get craters Y axis position the same as players Y axis position. I'm using prefab to randomly spawn meteors and craters, the meteor always has one crater that is on its impact position(X and Z) but now I only need to set Y position so its always on planets surface. If you help, Thank you! (And if you only read this, thanks again)
I don't understand the question so I'll answer:
Vector3.Project( Crater.transform.position , Player.transform.up )-Player.transform.position;
Tip: Elaborate/visualize the question to get better ones
Your answer
Follow this Question
Related Questions
How to dynamically set transform positions (for a Bezier curve)? 2 Answers
I need help with the location of instatiated objects on the scene and correct interaction with this 2 Answers
Why can't I instantiate an object that is +5 in the x and z axis? 1 Answer
How can I Instantiate a prefab (projectile) consistently from the character? 0 Answers
Simultaneously moving GameObjects using C# script. 3 Answers