Jump to content

How can I move the SpaceCenter camera to a new Object


Recommended Posts

  • 3 weeks later...

You want to move the camera, or change its focus? Changing its focus would just require rotating it to look at something else, which you can do with camera.transform.LookAt(Vector3 position).

KSP has multiple cameras, so you might need to move more than just the main camera (or the other cameras might be children of the main camera and would rotate along with it). And KSP might also try to move its focus back.

You can try to look into the SpaceCenterCamera class, if you haven't already, though I'm not sure where you can get a reference to it from KSP.

Link to comment
Share on other sites

On ‎11‎.‎06‎.‎2017 at 9:14 AM, JPLRepo said:

Moving the cameraS will be problematic. Yes there are multiple cameras.
Where do you want to move it to?

My plan was to move the camera to a different base. (for Kerbal-Konstructs) from my testing the best case I got was a short blink of the selected base, but then it switched back to the KSC.

I tried the following


// I only got one cam in the KSC overview
SpaceCenterCamera2 cam in Resources.FindObjectsOfTypeAll(typeof(SpaceCenterCamera2).First() 

cam.transform.position = [newposition I got elsewhere]

after reading your latest devblog I think I might have missed something, perhaps the I didn't move the master cam object or something else is resetting the cam, when ist is to far away from the KSC PQSCity object, because in the KSCSwitcher mod there is nothing special done to move the cam, so maybe it is tied to the PQSCity GameObject,
 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...