Disabling crosshair when aiming down sights & zoom effect

Do this if you want the crosshair to disappear when aiming down sights.


Also this if you want to add a nice zoom-in effect when aiming down sights. Delta seconds can be drawn from your Tick Event node - I just promoted it to a variable for a cleaner graph.


Thank you !

Hi, tried following your instructions but it seems that for me it did not work.

Here’s my setup, could the new enhanced input system be causing issues? I have used it rather than the old system for this course.

Oh and I left the visibility bit out because I wanted to keep the crosshair if I needed it for debugging.

Hmm, I’m not sure why the new input system would make this not work.

Did you make sure to draw the Delta Seconds variable from the Event Tick node?

Also, make sure you don’t have any other code that’s making your FOV be 90 all the time.

Other than that, I’m not sure what you could do :frowning:

Can I see your code for your input?

Everything should be as you said, interesting problem. In a way it doesn’t matter, I was just testing this educational purposes but I have a code plugin from the marketplace that should handle this on it’s own way. QuickStart! – EMMA Docs the plugin is free and looks like a good way to quickly setup a FPS game.

Sure, it’s just the basic Enhanced Input system though.

There’s the bit concerning aiming input. I was just thinking that is the logic somehow different behind the new system vs the old system so that it makes that way of doing it not functional. I feel like there shouldn’t be anything like that going on but I’m still learning!

I actually tried to put the FOV changing part of the code after the aim inputs and messed around with it a while and it didn’t work.

Something tells me you should try all the other outputs from the IA_Aiming Node.

Hmm, I didn’t mess with that node because I was thinking it would mess up aiming, I need to test this a bit!

Started and Completed will probably get you the best results here.

Also, have you set the context in your player controller? I’m making the assumption that you’ve tested with movement already.

You could try adding a Flip Flop Node on the Started or Triggered pin (I’m not sure which), and connect the Set Is Aiming to the Flip Flop node.

Might work.

Both good suggestions but seem not to do anything. And yes movement is working fine. Yesterday I did have some success using a method I found online.

I took this from the video as I did not leave the code in my project. In this video the control for the zoom was done with right mouse button after which there was similar is aiming nodes as is in my code. So I tried doing a similar setup after my is aiming nodes and it half worked: the game starts normally but if you aim it flickers a bit and then stays in the zoomed in view and if I released the right mouse button it would zoom in even more lol. I tried various different configurations but it wouldn’t change that behavior.

I would need to look at the project more directly to find the issue at this point. Using Enhanced Input on its own shouldn’t lead to behaviour like this.

I’ll ask again after I’ve tried the code plugin I have and it doesn’t work lol, it’s not mission critical that it doesn’t work for this project.

I put it behind the aiming input, works fine there. :slightly_smiling_face:

1 Like

Cool that you got it working !

Privacy & Terms