- Home /
Get position relative to another
So I'm working on a game that's a bit of a 2D/3D hybrid. Players control airplanes across a 2D field while said field flies through the game environment. The idea is to create something accessible, yet cinematic.
To properly be able to apply thrust to move the 3D planes to their correct position, I need to know their relative positions to their "master". The 3D planes aren't children of their 2D representations.
Answer by JackhammerGaming · Jan 21 at 06:03 PM
@Hogge Assuming that you want to know position of all your planes relative to same 2D object you can do
Vector3.Distance(plane.transform.position , master.transform.position)
this way you can know each plane's position relative to it's master in a scalar value you can then play around with the values of plane however you want
I need to know the RELATIVE POSITIONS of the objects. I can just thrust them towards the object, of course, but I have lots of issues.
Your answer
Follow this Question
Related Questions
can i let the sphere follow a point(x.y. or.z) on plane? 1 Answer
How can i change position of my character 0 Answers
transform.position return the wrong value 0 Answers
Help with this script? Keeps moving my objects around in run-time? 0 Answers
A performance question related to setting the position of non-visible objects 1 Answer