Find GameObject Position(x,z) and rotation(y)

How do I can locate the position and rotation of an object in constant motion?

I am creating a car neon lights, for better performance!

Hi gonzalo rivero!

theCar.transform.position will give you a Vector3 variable (Vector3 are 3 floats stored in a single var. Ex (x,y,z))
theCar.transform.eulerAngles will give you another Vector3 variable.

I would put this in the update function of your neon lights script.

Don’t forget to make some Maths! Because if you say something like:

neonLight.transform.position = theCar.transform.position;
neonLight.transform.eulerAngles = theCar.transform.eulerAngles;

It will simply follow the car from its Origin…

If you need more tips, please consider showing me more infos in your question!

Bests
Math