Announcement

Collapse
No announcement yet.

utcamera

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

    utcamera

    Hello,

    if i'm going to create my own camera class but i want to extend from the utgame camera system in the utplayercontrol what will be the class to extend from in the line :

    class blablaPlayerCamera extends ??;

    #2
    any help ?

    Comment


      #3
      Hello dude, I am by no means an expert in Unreal Script, however, so long as no one answered you untill now, I will try to help you.

      For my third person camera, I simply used the behindview camera with some offsets, and it is coded inside my custom Pawn:

      Code:
      class FursanAqsaPawn extends UTPawn;
      then some lines down:

      Code:
      //override to make player mesh visible by default
      simulated event BecomeViewTarget( PlayerController PC )
      {
         local UTPlayerController UTPC;
      
         Super.BecomeViewTarget(PC);
      
         if (LocalPlayer(PC.Player) != None)
         {
            UTPC = UTPlayerController(PC);
            if (UTPC != None)
            {
               //set player controller to behind view and make mesh visible
               //since we are not using the Pawn.CalcCamera() function so camera animations (chainsaw execution, i.e) will work normally
               UTPC.SetBehindView(true);
               SetMeshVisibility(UTPC.bBehindView);
            }
         }
      }
      then on the default properties:

      Code:
      defaultproperties
      {
      
          CamOffset = (X=6, Y=15, Z=-22);
          //CamOffset = (X=6, Y=15, Z=-28);
          //x -> distance from camera
          //y -> horizontal position
          //z -> vertical position
      However, if you want to do a camera class, you can declare this way:

      Code:
      class FursanAqsaCamera extends GamePlayerCamera;
      GamePlayerCamera class is located in Development\Src\GameFramework\Classes

      We all know that in programming there are many ways to do the same things. As for UDK Camera Programming, some people do the camera code inside the player controller, others do on the pawn (like me), others create a custom camera class. It all depends on what you want and your skills.

      For my game, this behindview camera with some offsets worked perfectly. So if you want to do a third person camera, you can also see some tutorials on youtube, which discuss how to create some cool third person cameras.



      Cheers.
      Last edited by udkultimate; 10-10-2018, 05:16 PM.

      Comment


        #4
        There are plenty of cameras on the UDN documentation, why extending UT? well it's up to you
        Some cool unreal projects you may like!


        Developer of GOTA - Survivalism Gladiatorial game Buy the game Buy it have fun

        Download the demo Download the demo
        external link Dropbox DropBox

        Become a c++ Professional now C++ Networking Tutorial

        Comment


          #5
          great thank you for your help I appreciate that a lot

          Comment

          Working...
          X