Problems with scope on Sniper Rifle and Assault Rifle

I have the scopes set up on both the sniper rifle and assault rifle, but seem to be having some slight issues.

1. On the assault rifle when the right mouse is clicked the view changes to down the scope, however to view thought the scope isn't working as it should


2. On the sniper rifle when the right mouse is clicked the view changes but the sniper scope crosshairs don't show


I have attached a video clip and some images showing both scope views


 

Attachments

Have you tried comparing the settings with the assault rifle scope within the demo scene? This is likely something related to the camera's culling mask. Also, if you haven't seen it, this page describes how to setup the scope: https://opsive.com/support/documentation/ultimate-character-controller/items/actions/usable/shootable-weapon/
Yeah, I compared them and they looked the same

I started again with the assault rifle and followed the guide and I'm almost there :)
 
I got the Assault Rifle fixes, turned out I hadn't set the scopes camera position - copied this from Nolan and it worked.

Still trying to get the aim overlay for the sniper Rifle to work - proving a bit tricky
 

bluebird

Member
Hi,

I followed those 6 steps for scope and also copied transform of camera & camera component itself from demo scene, but no luck!

depth value of main camera is 1 & for scope camera it's 0.
I attached a screenshots for reference.
 

Attachments

bluebird

Member
Hi,

I followed those 6 steps for scope and also copied transform of camera & camera component itself from demo scene, but no luck!

depth value of main camera is 1 & for scope camera it's 0.
I attached a screenshots for reference.
@Justin Can you look at above set up?
Did I miss something to set up?

I noticed that in demo scene sniper canvas is individual object in hierarchy. but when we set up monitors and virtual controls from manager, SniperRifleUI is child of parent game object Monitors.
This is the only difference I noticed.
 
Last edited:

Justin

Administrator
Staff member
From a UI perspective the only difference between the sniper and the assault rifle is that the sniper specifies which full screen UI to show. This UI has an ID and that ID is specified on the FullScreenItemUIMonitor, which is on the SniperRifleUI GameObject in the demo scene.
 

bluebird

Member
@Justin, I searched this inside document but unluckily didn't find !!
btw, I did as you said still full screen ui canvas isn't visible.

1353

1354
 
Last edited:

Justin

Administrator
Staff member
When you aim do you have a state which sets Show Full Screen UI to true? The AimSniperRifleItemPreset preset within the demo scene is an example of this. This will then enable the GameObject that the FullScreenItemUIMonitor component is on.
 

bluebird

Member
When you aim do you have a state which sets Show Full Screen UI to true? The AimSniperRifleItemPreset preset within the demo scene is an example of this. This will then enable the GameObject that the FullScreenItemUIMonitor component is on.
Nope. I don't have such state. I have only default state on sniper rifle inside item component.
Can I use AimSniperRifleItemPreset into my scene?
 
Top