What Preset Sets Camera Zoom

SteveC

Member
Good morning, y'all!

What preset sets the camera zoom level when a weapon aims?

Trying to set up a sniper rifle, using the SniperCanvas from the demo scene as a test, and it works great but needs a little tweaking on the actual zoom level since the player's still visible in the scope.

Sorry, couldn't figure out how to get a screenshot while holding the RMouse button in zoom or where to put a break in the code.

Thanks much!

[EDIT]
Put my Debug.Break() at the end of FullScreenItemUIMonitor.OnShowItemUI:

Code:
// Original
m_GameObject.SetActive(m_ShowUI && show);

// Added
if(m_ShowUI && show) {
         // Auto-pause when we show the UI; wait 1 sec so we'll be fully aiming
         Invoke ("DoBreak", 1.0f);
}

public void DoBreak() { Debug.Break (); }

1552496394689.png


... the character is still in the reticle. I assumed I could do this pretty easily with a State, and decided my best bet was to use "Append Item" in UltimateCharacterLocomotion.ItemAbilities for "Aim", but can't figure out which State actually needs to be tweaked here.

As an additional question on specifics, in UltimateCharacterLocomotion.ItemAbilities, what would the State be named if "Append Item" is TRUE? What is actually used as the appended Item name? For example, if I had an Item named "ARX200 Assault Rifle", but the name of the object in the hierarchy holding the Item (ItemPlacement under Character) was named "AssaultRifle1". Would the "Aim" State then be something like "Aim_ARX200 Assault Rifle" or "Aim_AssaultRifle1"?
 

Attachments

  • 1552489329294.png
    1552489329294.png
    87.2 KB · Views: 8
Last edited:
Seems like what I'm looking to set is something like the "ZoomThirdPersonAdventurePreset", but I'll be damned if I can't figure out where that's applied =)

Minus this hiccup, pretty great effect, though!
 
Last edited:
Thanks Justin!

Sorry, I'm still a bit confused on how I can apply that. I see the State's set in CameraController.SetZoom, but where is the Preset applied in this State?

Seems like I need to be using a modified version of ZoomThirdPersonAdventurePreset, but can't figure out how that actually gets applied in the Zoom State.

Adjusting the values in this Preset works:

1552517191484.png

... but what component is actually applying this Preset?
 
Last edited:
Ah, that state gets set with the Zoom State field on the Camera Controller inspector. If Append Item is selected then the item name will be appended to the zoom state name.
 
Honestly, it was so easy... that it was hard =)

For posterity's sake, if anyone else is looking for it, it's on the CameraController and you hafta' click on the ViewTypes item to see the absolutely gigantic foldout:

1552517696102.png

Can't believe I hadn't noticed where this was hiding. This also helps me make some sense of how ViewTypes might be applied in Cinemachine.

Thanks much Justin!
 
Top