Hello and good day to all! I have a few camera questions. If I can get these working I will post a package to the wiki, as I think these could be invaluable to others just starting out in the simulation world.
A.) I want to have a ‘flight’ camera and a ‘walk’ camera setup in my scene and be able to toggle between the two using a hotkey. That being said I have the walk camera already set up. Now I need to setup a flight camera. I would like the camera to be able fly using the same controls as the walk camera, but(and this is a big one) to not roll over. I would like the fucntionality of looking up down and all around. The scripting I have seen on cameras confuses me so far.
B.) When I toggle to walk from flight I would wish for the walk camera to ‘drop’ from the flight camera directly to the ground. I will also have the option of using a gamepad as an alternative from the mouse/keyboard.
C.) Can I set up predefined viewpoints for the camera to ‘snap’ to to start from? For instance, whether flying or walking there may be certain areas/views from within the simulation where the client might see a specific importance. The user could be either be in walk or flight mode and ‘automagically’ move to one of those preset points(and switch to walk mode if not already in it) when pressing a numeral key(or a button on the gamepad).
I have asked about the camera switching issue before but I was confused and I don’t think I was as specific as to what my current needs/issues are.
Thanks again for everbody’s help and assistance for my varying issues while I get used to using this tremendous tool!
Cheers,
Gary
Hiya,
As far as C, you sure can… I am guessing there are all kinds of ways to do this… One in particular could be the placement of empty GOs if the spots of interest, you could move the camera between those points. There is a bunch of code up here that shows doing this but if you can’t track any down give a holler and I have some laying around I can pass up here to get you started (just don’t have it handy right this second).
As far as B, I am not really sure what you are looking for here in regards to help. It should be a matter of just moving you camera from point A to B every instantly or over time based on what type of feel you want.
And A, seems like you could take some of the canned scripts and play with the properties a bit to get the effect you are looking for. Then simply turning the scripts attached to one camera and that camera off and turning the other camera and it’s scripts on.
HTH and if you need some snippets etc. just give a holler… I apologize for not having readily at hand.
Regards,
– Clint
littlelingo,
Thank you so very much for the tips. I have been searching and continue to search the forums. Not much luck yet. If you could look for some code that could help me out that would be greatly appreciated. I will continue to look in the mean time.
Cheers,
Gary
Still seeking help on the camera issues. Is there a flying camera script in javascript somewhere? I think I understand JavaScript the best and I am looking for some further code/hints with my problems above. Thanks for your time.
Gary
Hiya,
Sorry haven’t had a chance on those scripts yet… There are some sample projects that use a bunch of different camera type scripts one in particular would be the Character Animation Demo:
http://unity3d.com/gallery/demos/index.html
HTH,
– Clint