Announcement

Collapse
No announcement yet.

Camera to Bone Attachment[umm Help?]

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Camera to Bone Attachment[umm Help?]

    I've scoured the net in search of any infomation regarding attaching cameras to bones, and have not found any info.

    What I'm after doing is attaching a secondary camera to a vehicle bone which would then be connected to a scripted texture which would be displayed in the cockpit on a monitor for a realtime Targeting lock texture.

    Can anyone help, or point me in the right direction?

    #2
    It's not really that hard, you can use any dud ONSweapon as you 'camera' (so you can even aim it )

    You can spawn a camaera texture client anyhere and link it to the texture slot you need with a few combiner and scripted texture tricks.


    Make sure to look up Angel_Mappers tutorial on making camera's net compatible, i don't recall the exact changes you need to make, but i've done similar things myself (FYI only works in D3D or OGL with a specific fix, also causes huge FPS loss)

    Comment


      #3
      I can't help you with the ScriptedTexture / monitor part, but this is what I did to attach a camera to a pawn's bone:

      1) Create a new class to be the camera with no code inside:

      Code:
      class MyCamera extends Actor
      
      DefaultProperties
      {
      
      }
      2) Make your pawn - in your case the vehicle - spawn that camera and attach it to the bone:

      Code:
      // inside your vehicle class:
      
      var MyCamera camera;
      
      simulated function PostBeginPlay()
      {
           super.PostBeginPlay();
      
           camera = spawn(class'MyCamera');
           AttachtoBone(camera,'bone_name');
      }
      3) From now on, if you want to use the camera as your point of view, you must call the setviewtarget() inside some function:

      Code:
      //inside your vehicle class:
      function MyFunction()
      {
            local playercontroller pc;
      
            pc = Level.GetLocalPlayerController();
            pc.setviewtarget(camera);
      }
      But I don't know if this last part is necessary for the ScriptedTexture / monitor stuff. You can look at the Ballistic Weapons mod code since they do this exact thing in for their M50 assault rifle camera. Theyr code is very well commented.

      Comment


        #4
        Thanks for the info guys.
        Gonna give it a shot now.

        Comment

        Working...
        X