I am using the FPS prebuild, but I can’t get the onClick to destroy the actor that I am clicking when the reticle is over the actor what am I doing wrong here? I have removed the spawn actor on left click and removed the projectile class as well.
Did you check if the event is firing at all?
Have you ensured that your Player Controller has Enable Click Events checked in the Details panel? If you’ve modified your player controller, you’ll have to click the Class Defaults option and then the Details panel you need will appear.
Have a great day,
I see what you’re trying to do now. In order to get the behavior you’re looking for, you’ll have to do a bit of work. Take a look at this post: https://answers.unrealengine.com/questions/307385/how-to-set-up-using-mouse-cursor-for-aim.html and try to mimic the setup that I’ve shown in my answer. This setup allows you to turn the camera and use the mouse for click events. You don’t have to mimic the crosshair part if you don’t want to. Let me know how it works for you.
Have a great day,
I don’t see any options to click enable click events, would I have removed them when I deleted the blueprint code for the fire projectile code?
Yeah I did and it’s not even firing from the on clicked part nothing is lighting up.
That actually gives me some weird results with the mouse look around and clicking on the object still doesn’t work to destroy the object. I think that mouse clicking in FPS might not be the best option so I need to figure out how to do an actor destroy when the reticle is over the object when I use the keyboard to interact with the object.
Have you ensured that you set your player controller to receive input from player 0? Just want to make sure that isn’t something that we’re missing. It’s definitely not the best option if you start with the template because there are a lot of things that need to be altered. I’ve been able to use that same behavior in a third person project as well, and had the camera movement and click events working. In order to do something like what you’re talking about (destroying an object when the reticule is over it with a key press), you could try using a line trace and then destroying the object it collides with. It’s worth giving a shot, I’d say: https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseRaycasts/Blueprints/index.html
I look forward to hearing your results,
That looks like it will help me a lot I will try and implement that tonight after class thank you. I will update you with the results.
Yeah that is what I was looking for Thank You for your help with this matter I greatly appreciate it.