Announcement

Collapse
No announcement yet.

Switching Cameras

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

    Switching Cameras

    I'm trying to implement a camera system where say if players presses F1 it will switch First person mode and then switch back 3rd person mode.What is the better approach?Having 2 camera components on blueprint?I couldnt seem to find a tutorial on this.

    #2
    Instead of using two cameras, you can have a SpringArmComponent attached to the root. When you switch to third person, attach the camera to the SpringArmComponent, otherwise attach the camera to the root component directly. You would need to set UseControllerViewRotation for the camera accordingly and also reset the pitch of the relative camera rotation to 0 after switching to third person.

    Comment


      #3
      In the next release you can use the 'Activation' state of a CameraComponent to enable/disable it, which would make your '2 camera component' approach work well. For now, doing as cbuttner suggests will work I think, or you can override CalcCamera to choose which camera component to use (see AActor::CalcCamera).
      Lead Programmer - UE4 Animation/Physics/Audio Team - Epic Games
      Twitter: @EpicJamesG

      Comment


        #4
        Thanks James!

        Comment


          #5
          Originally posted by JamesG View Post
          In the next release you can use the 'Activation' state of a CameraComponent to enable/disable it, which would make your '2 camera component' approach work well. For now, doing as cbuttner suggests will work I think, or you can override CalcCamera to choose which camera component to use (see AActor::CalcCamera).
          Can Blueprints be used to overide CalcCamera?

          Comment


            #6
            Originally posted by Venged View Post
            Can Blueprints be used to overide CalcCamera?
            Not currently, but it is something we are discussing.
            Lead Programmer - UE4 Animation/Physics/Audio Team - Epic Games
            Twitter: @EpicJamesG

            Comment

            Working...
            X