- Home /
About Camera Change & switch GamePlay
Sorry about bab english. I want to do this: When i with an fps camera comes near a car and press a key. camera switch to camera s that attacked to car object and game play swith from fps to car control and so back. like gta or fps games with car. I am write car physic and fps control but cant whrite switch game play mod. I want help. thanks.
make changes to your original post. Don't submit answers with more info.
Answer by inkspot · Jul 17, 2013 at 03:36 PM
There are serval ways you can do this, one simple example is when you want to use a key input for example 'e' to enter the car, is using an object 'tag' for the car object ;
http://docs.unity3d.com/Documentation/ScriptReference/GameObject-tag.html
And using a raycast function;
http://docs.unity3d.com/Documentation/ScriptReference/Physics.Raycast.html?from=RaycastHit
In order to detect that tag/object, if the tag is detected by the raycast, then simply switch to the other camera.
Your answer
![](https://koobas.hobune.stream/wayback/20220613110304im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
A node in a childnode? 1 Answer
MiniMap with player and object icons 1 Answer
Camera Movement (One Position to Another) 1 Answer
Switching Cameras - Confusion with Two Code Samples 2 Answers
Camera in fixed position which rotates with player. 0 Answers