Camera not moving with car- How Can I change parent object while playing?
Hi, I am making FPS game, I have FPS controller, and two cars. I have Camera in FPS Character, and another camera in one of cars. Everything is fine, even if I enter a first car, I have there FPS camera , but when I enter second car, camera is targeting on first car, and is not moving. I know why, because its parent object is first car. So how can I change parent object of camera while playing? I am using Unity 4.7. ,basic FPS character from Assets, and in car Mouse Look Script. I tried create another camera, i putted it in second car,but it doesnt worked.
Answer by Abhiroop-Tandon · Apr 04, 2016 at 08:29 AM
You can check for a collision or trigger however you want to detect the thing and then you can change the parent by
transform.parent = other.transform;
Your answer
Follow this Question
Related Questions
Partial synchronization of camera with the bone of the head or other object 0 Answers
Camera distance affects FPS, FPS grows as the camera moves away 0 Answers
Character runs off screen Side Scroller Infinite Runner 0 Answers
How to smooth the movement of the camera? 0 Answers
Unity 5 FPS Camera 0 Answers