Jump to content

Did FlightCamera.setTarget() disappear?? (Notice setTarget, NOT SetTarget)


Recommended Posts

My sound plugin recompiled with little trouble (aside from me trying to get into the workflow of Visual Studio instead of MonoDevelop) - but my docking cam hit a snag...

Error	CS1061	'FlightCamera' does not contain a definition for 'setTarget' and no extension method 'setTarget' accepting a first argument of type 'FlightCamera' could be found (are you missing a using directive or an assembly reference?)	KOAS	X:\Ted\Documents\Source\Repos\Kerbal-Optical-Alignment-System\KOAS-DPCamera.cs	129	Active

I have Referenced Assembly-Csharp and UnityEngine  (Dropped KSPutil as I saw it is gone having been "folded" into Assembly-CSharp), so I'm wondering if it moved or if it's gone.

If it's gone, was it replaced with something else?  

Honestly I'm not entirely convinced it really matters.  With "Aim Here" functionality added in game, you can practically do the same thing with a few steps - although my camera view was IN FRONT of the port, not behind it and relying on the model having no camera facing polys / normals.

EDIT: Setting the target to a transform basically "positioned" the camera in that spot.  Without that setting (I just commented out the FlightCamera.setTarget lines) I get it to build but in game I simply get a camera view outside the vessel that's locked and has an overlay...  

Edited by tg626
Link to comment
Share on other sites

Don't know what you are talking about?
FlightCamera contains the following public methods:
SetTarget(Vessel), SetTarget(Part), SetTarget(Transform), SetTarget(transform, FlightCamera.TargetMode), SetTargetNone(), SetTargetPart(Part), SetTargetTransform(Transform), SetTargetVessel(Vessel).
and the first three are Static.
They did change. So you should make a change to your code.

and as this is a PreRelease 1.2 question it should be in the 1.2 Pre-Release Modding sub-forum.

Edited by JPLRepo
Link to comment
Share on other sites

Sorry I got the forum wrong, maybe a mod will move it?

The are (were?) Two of them.

.setTarget 

And

.SetTarget

I, and others, use .setTarget and simply changing to .SetTarget doesn't work.  It results in an error stating it's ambiguous.  Saying it can't tell if it's FlighCamera.SetTarget( part ) or FlighCamera.SetTarget( vessel ) 

According to the API docs FlighCamera.SetTarget was a static void method, and FlighCamera.setTarget was a void method.

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.

×
×
  • Create New...