|
I'd like to know how I would get this to work correctly. For those who have played Homeworld 1 or pretty much any space RTS you are able to move the camera around by holding the right mouse button and then moving the mouse. You are also able to scroll in and out using the scroll wheel. I've seen some things like this around here but they have all mainly been for Land based RTS's and haven't given me the desired result even with a bit of tinkering. Any Help is appreciated.
(comments are locked)
|
|
This script will allow you to assign (using the Input Manager), two axes for Camera Movement, one for "Camera Enable" (which, in your case, should be the right mouse button), as well as camera rotation and a "Camera Rotation Enabler" (which, for my game, was the middle mouse button). So the end result of this script, after all the input axes are setup correctly, is: Hold RMB to drag and move the camera around. Hold MMB (Scroll Wheel) and drag left or right to rotate the camera around. I don't remember what the values were inside of the Input Manager (and I don't think I have the project anymore), so you'll need to figure that out yourself by reading this script and assigning values to the functions noted in the script. This will NOT work by just copy-pasting it! Input Values that need to be added:
WOW Thanks. Sadly I am new to unity so i'm not sure how exactly to get this running but I'll toy with it and see what I can do. Thanks
Apr 05 '10 at 08:00 PM
Ethan
When I edit the values (which i may be doing wrong) even after I do I play the game to test my camera and I get a ton of "no semi colon" Errors. Any Ideas?
Apr 05 '10 at 08:25 PM
Ethan
Ah Nevermind! This is a C# Script. I think I can get those values correct shouldn't be too hard.
Apr 05 '10 at 11:36 PM
Ethan
Heh Heh. I am probably really get annoying and I apologize. As if you will ever see this. I can't seem to get the values correct. This will be the last time I ask but any Ideas?
Apr 05 '10 at 11:57 PM
Ethan
It is a bit advanced, unfortunately. I think you have to strip it down and understand it in depth, compare it with the default mouse look in the first person controller too, might help.
Apr 06 '10 at 08:18 AM
alexnode
(comments are locked)
|
|
Okay... here's all the relevant input settings from that project. Everything needs to match pretty much exactly for it to work (the names especially). Edit: This is far from perfect... I have duplicate input types, and gravity doesn't need to be "9999"... but if you plug these values in it should work.
I'll get these all matched up and tell you how that goes. Again thanks for all this.
Apr 07 '10 at 01:32 AM
Ethan
I keep getting a console error that it needs the Move Camera Enabler Inputs.
Apr 07 '10 at 07:56 PM
Ethan
Edited my post to add it in. Sorry about that :)
Apr 07 '10 at 10:41 PM
qJake
It appears to work, sort of, if I mess with the camera after a few seconds Unity locks up and crashes.
Apr 07 '10 at 11:52 PM
Ethan
I dunno what the problem is... you may have another conflicting script on your camera or something, I really don't know... you'll just have to play with it and try to make it work.
Apr 08 '10 at 12:24 AM
qJake
(comments are locked)
|
|
Following this example word-for-word, I end up crashing Unity. Not cool. Seems to be something specifically with the Camera Zoom. It would be nice if someone could update this with something less suboptimal.
(comments are locked)
|



or like pressing alt left click in the scene window while using the scroll wheel. I would like that too.