Unreal Engine Aim and Shoot?
Good evening, I asked a question about UE 4 a while ago and received an excellent answer. Thanks again to the community. Now I'm faced with another problem. My character has a weapon in his hand, and I'd like him to start aiming and then shooting by right-clicking. The only thing I know is that this can be done with a blueprint.
I've already clicked through all sorts of YouTube videos but somehow it didn't really help me. Maybe someone can recommend a video or give me step-by-step instructions.
I thank everyone for their answers and try to understand everything, well I'm still learning UE, please forgive me.
Thank you in advance for any answer, have a nice evening.
PS: I don't know if this makes a difference but I'm working on a top down shooter
Hey, it’s great that you want to trust with unreal engine! I would recommend unreal engine 5 to you, because I rather prioritize the interface.
To let your charite try to keep it as simple as possible. Get in your character blueprint
1. Create a Boolean variable in your character blueprint with the name “IsAiming”
Two. Add an input event for the right mouse button and connect it with the following steps:
– Set the “IsAiming” variable to “True” if the right mouse button is pressed.
– Create an input event for the left mouse click and connect it with a branch (Branch)
– Use the branch to check whether the character is in target mode (i.e. whether the variable “IsAiming” is set to “True”).
– If the character is in target mode, you can change the position of your camera.
– If the character is in target mode, add the firing process, such as playing a shot animation or triggering a shot function with the left mouse button.
I hope I could help you with this 🙂
Thank you very much for your detailed and quick answer to the question, that has helped me very much. I don’t understand how I set the variable on True when the mouse button is clicked, so what module I need for it. When I finished that, the next question for me is how to play an animation with the left mouse button. I still didn’t understand this in the countless turtorials. But thank you again for the answer 🙂
You can check it with an input event. To do this, you enter your character blueprint, click in your graph with your right mouse button on an empty space, select “Input > Right Mouse Button”. As soon as you activate the right mouse button, the Boolian variable (which you have connected to the input event) is set to true.
This video may help you: https://youtu.be/5nNGq6fS6vI
I would advise you to familiarize yourself with the blueprints 🙂
Hi thank you for your answer, so I come forward well, thank you a nice evening