Announcement

Collapse
No announcement yet.

How to Create PUBG style Sniper Zoom Function

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

    How to Create PUBG style Sniper Zoom Function

    Hi
    I'm trying to create a sniper scope with zoom function just like PUBG but i'm having trouble when i try to zoom-in as it also zooms on the scope mesh itself which is not correct.
    here is a video of how pubg scope works:

    https://youtu.be/QXMN2JHkR2s?t=567

    as you can see in the video when the camera zooms out, the location of the scope on screen stays the same size. at first one might think there are 2 cameras but it's not and thats because the outside part of the scope is also affected by camera FOV.
    so any ideas how this can be done?
    Thanks !

    #2
    I'd imagine one camera renders the environment and one camera renders the weapons. Weapons are then overlayed onto the screen, and you can freely change the environment and weapon camera FOV.
    Working on King Arthur: Knight's Tale.

    Comment


      #3

      Originally posted by STRiFE278 View Post
      I'd imagine one camera renders the environment and one camera renders the weapons. Weapons are then overlayed onto the screen, and you can freely change the environment and weapon camera FOV.
      How can TWO cameras be overlaid in UE4 though?
      UE4 doesn't offer a whole lot of options to do this...

      Option1: RenderTexture (Can be expensive, but there's lots of flexible control).
      Option2: Split-Screen (Zero control... Not much flexibility in Blueprints anyway).
      Option3. Marketplace Plugins (Can any of these products help? - Free / Paid).



      Originally posted by Kanade Sama View Post
      i'm having trouble when i try to zoom-in as it also zooms on the scope mesh itself which is not correct.
      What is your setup right now? Using render texture is the same as the classic security camera trick, so search on YT for tutorials using those keywords if you need to. But basically you attach a Scene-Capture-2D cam to the weapon, and then assign a 2D texture and create a material from all of that. Its less involved than it sounds and pretty easy. You then alter the FOV on the Scene-Capture-2D cam to mimic the zoom.

      If using FOV doesn't match expectations, you can also just move the 2D camera closer to the action or away from it. Either way, both options can be driven from a Timeline etc. The sniper display itself is a plane / mesh with the material from the 2D Texture. BTW: In some weapon setups / scenarios, you may even be able to use a RenderTexture as the blurred background (projected onto a mesh with a round porous hole), and then just apply FOV changes to a normal camera (as the render texture plane / mesh will occlude the background). Placing an only-owner-see mesh or widget over the camera view could then complete the effect.

      EDIT: This might of interest also...
      Last edited by UnrealEnterprise; 07-25-2020, 11:36 PM.
      ----------------------------------------------------------------------------------------------------------
      What are the BEST Unreal Tutorials / Docs? There are none tbh... Here's why
      Instead its better to just take projects apart (see the free 'creators' listed here)

      Comment


        #4
        Originally posted by EntrpriseCustomr View Post
        How can TWO cameras be overlaid in UE4 though? UE4 doesn't offer a whole lot of options to do this...
        To be honest I just assumed it was done this way in unreal as well, since in Unity this is a fairly basic thing to do.
        Working on King Arthur: Knight's Tale.

        Comment

        Working...
        X