Announcement

Collapse
No announcement yet.

3rd Person Camera - Code

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

    #16
    maybe i am stupid .... but it still doesen't work ;/ maybe it's something wrong with the code .... i don't know ....



    and this is how it look after the cinematic

    Comment


      #17
      i have the same problem after using matinee. i have however narrowed down the problem to the director track in matinee. im using the code posted at the beginning and followed the cinematic video tutorial for the udk. If you remove the director track it works but you can't view the cinematic and im not sure how you can set the camera back to normal from the Director track.

      Comment


        #18
        I had this same problem yesterday. Here's a reply I made earlier on the fix.

        Comment


          #19
          ok it works with fegin deth but after matine with camera the caracter is still invisible

          Comment


            #20
            I also still have the same problem, but like i said earlier there is something about the director track in matinee which is causing it.

            Comment


              #21
              I messed around a bit and figured out how to fix your issue in UnrealScript.

              Add the following to your player controller:

              Code:
              function SetCameraMode( name NewCamMode )
              {
              	// will get set back to true below, if necessary
              	bDebugFreeCam = FALSE;
              
              	if ( PlayerCamera != None )
              	{
              		Super.SetCameraMode(NewCamMode);
              	}
              	else if ( NewCamMode == 'ThirdPerson' )
              	{
              		if ( !bBehindView )
              			SetBehindView(true);
              	}
              	else if ( NewCamMode == 'FreeCam' )
              	{
              		if ( !bBehindView )
              		{
              			SetBehindView(true);
              		}
              		bDebugFreeCam = TRUE;
              		DebugFreeCamRot = Rotation;
              	}
              	else
              	{
              		if ( bBehindView )
              			//SetBehindView(false);
              	}
              }
              This is the same function in UTController, with the change in bold.

              Try it out and see if that will work for you.

              Comment


                #22
                works perfectly !! you're brilliant! ;] thanks a lot for help!!

                Comment


                  #23
                  gallo why do i get this error when compiling :

                  Error, 'SetBehindView': Bad command or expression

                  edit nvm: forgot to set it to class extends utplayercontroller

                  Comment


                    #24
                    hey with this i can make a mirrors edge type of view? becouse i have add my custom gametype and etc but i want to have the first person shooter view but everytime i play the level with my gametype i get the trhidperson view please help

                    Comment


                      #25
                      Originally posted by alvarofer0020 View Post
                      hey with this i can make a mirrors edge type of view? becouse i have add my custom gametype and etc but i want to have the first person shooter view but everytime i play the level with my gametype i get the trhidperson view please help
                      The way this code works you will be inside the mesh if you try to set up that kind of view, and will just have random bits of occlusion, and that will just look bad.

                      I would check out this thread. What they are talking about is currently beyond me, but maybe skipgamer might elaborate on what they have set up if you ask.

                      Comment


                        #26
                        galloway when i use this code how come its only the gun and the body is invisible?

                        Comment


                          #27
                          It sounds like you don't have bBehindView = true set in the default properties of your player controller. If you open up the console and enter the command 'BehindView' and it fixes it, that's likely the issue. Otherwise there is probably something wrong in your pawn class.

                          Comment


                            #28
                            Originally posted by Cyber_Bruno View Post
                            Nicely done camera, iniside. I've been playing with the code you posted and modifying it some for the sake of seeing what I can do with it, and have to admit it's helped me learn some stuff about the nature of the default camera settings. (I'm a decent coder, but working with vectors and 3D environments is new for me.)
                            Something I've been trying to fiddle with, however, would be to produce an offset to the camera's starting position along the horizontal plane. The Z-axis code is already included in the default code (seeing as how your code here takes a lot from the default third person camera setup), but trying to get the formula right for the X/Y axes is proving to be a challenge. In your creation of this code or any of your work so far, have you played with anything along the same lines that you could point me towards? Much appreciated.
                            Some advices first:
                            Camera have transform pivot (just like object in any 3d app), that you can manipulate it. Diffrence is, that you can't actually see that pivot nor camera.
                            Second thing that transform pivot is local and it's relative to camera actuall position.

                            Horizontal position is actaully Y. Z is height and X is depth.
                            Anyway if you want to simply make offset of where is camera on start, ou simply need to add number to VectorX/Y/Z.

                            If you want something like Z-axis for other is not gonna work (at least in that case). To get this forumal working, I just play around with diffrent combinations of functions, compiles > play > see how it work > check something similar with graph drawing progam > change forumal in-code > recompile. Not very effective but actually works :E.

                            Comment


                              #29
                              Is there any way we could make it possible to zoom in and out or atleast make it so the views further back? Also how do I get rid of the camera attachment to the body/gun? whenever i move the mouse the body moves with it is there any way I could get rid of that ? sorry im new to coding haha thanks

                              Comment


                                #30
                                iniside, while I think I get what you mean, I was being a bit vague in that post I guess. I tried making a clearer call for help from the community that's gone unanswered here:

                                http://forums.epicgames.com/showthread.php?t=715178

                                Essentially the same way your code created a Z-axis offset to the camera's point of origin I need to create an X/Y offset. True X is technically depth, but when plugging in various numbers and formulas to the CamStart parameter the X values treat two opposing directions while the Y values treat two other opposing directions that are combined to effectively create the four cardinal directions. In other words, offsetting CamStart.X alone will put the camera way behind or in front of the pawn when facing it's front or back (depending), while doing very little if the pawn's sides are directly in front of the camera. Same goes for the CamStart.Y value. So I'm stuck figuring out some formula to make the CamStart point hold a position relative to a certain side or "face" of a pawn.

                                Hope that clears things up a bit. I'm currently using that same methodology of effectively just playing with the numbers to try and hammer something out right now though. I'm trying to move the point about which the camera rotates, which seems to be at least sync'd with CamStart from everything I've experienced.

                                Comment

                                Working...
                                X