- Home /
Camera at wrong place after build
Hi everyone,
i have a problem with a camera in my game. The camera is set on a car. It's like a driver view. But when i build my game and connect as a player to the car first, before i can do anything, i see the right view. But when everything is loaded and i could drive with the car the camera is set to the right corner of the car, like if you're looking out of the headlight.
I don't transform the camera in any part of my scripts. I had another Prolbem with the car when i wanted to rotate it. The car has the possiblity to turn on the spot, but it always turned around the same position like the camera is now (right headlight). I mad a workaround where i put a empty "center" gameobject to the middle and rotate it around that point, that worked. I now also tryed to set the camera to that point after start, but it doesn't work. It doesn't work either when i set different points for the camera in the script, the camera won't move. Did someone had a similar problem? Could it be a problem with the model of the car? Like i said, the center of the car object is not the real center of the object (remeber workaround ;)).
Anyone who could help me?
Answer by VIPINSIRWANI · Sep 26, 2013 at 01:03 PM
Public Camera cam;
Update() { cam.transform.position = new Vector3(car.transform.position.x - 0.5f, ..... , ........); }
Thx for the reply Vipinsirwani, but it doesn't work. The camera is still at the same location like the whole time.
Your answer
![](https://koobas.hobune.stream/wayback/20220613114834im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to make camera position relative to a specific target. 1 Answer
2 Cameras layer wont render till i turn it off/on 0 Answers
Camera.current.Render() renders AND makes a NullReferenceException error 0 Answers
Screen position out of view frustum error, cannot solve? 1 Answer
How to freeze camera? 1 Answer