|
Oi! unity people! if i have 1 player (the main one with a main camera) and have it so if I'm close enough i can push a button and change player and camera (so my guy disappears or is deactivated or something and i take over the controls of another) then push this button again and my character re-appear next to were i take this controller and the controller stay there.... basically this is for vehicles. kind of like a gta or halo or whatever and get into any vehicles and get out and carry on. thanks 4 your time :D. scripts would be appreciated :D
(comments are locked)
|
|
Create a general script for your game that lets you keep track of the currently active player and camera. Then in that same script, check if your 'change player' button is pressed, then simply activate the relevant camera, and character controller.
(comments are locked)
|
|
well, is just as you are asking " change player and camera (so my guy disappears or is deactivated or something and i take over the controls of another) then push this button again and my character re-appear next to were i take this controller and the controller stay there.... " if you have 2 cameras, 1 following your "main player" and the other on the vehicle, when you get near the vehicle, and press the button you choose, make a script to deactivate the camera on the player, and the player, then activate the vehicle and the camera of the vehicle, just a couple of booleans can make the trick and that was all you need, no scripts this time, this one would be better to learn on your own, but the pseudocode you have it, try to make your thoughts to script and you'll be on the right way hope this helps
(comments are locked)
|
