Mouse click events in First Person Template

Hello

After searching for a little in the UE4 answer section, I feel I need to post question here, for I did not find similar problem.
I am a new UE4 user, so I am just starting to learn all the ways to use UE4. And to get more confortable with the engine, I though I would try to create a boardgame with simple graphics. For that I needed a RTS(real time startegy) controller, what I could use to navigate in the boardgame scene. I followed this tutorial(link) to get myself a RTS controller. Finished the video and all worked like it did in the video. So far so good.

But then I wanted to create an Mouse event(OnClicked) so I could start designing the system. This is where the problem is. For some reason, the Mouse input events do not trigger. I guess it something to do with the First person Template I am using(what was used in tutorial). The mouse events itself work fine in top down template for example, but not in first person template.

So if anyone has any ideas what settings I need to change or Blueprint code to write, I would be very thankful. If you need any additional information, let me know.

Where are you trying to add the on clicked event?

Could you share a bit more information please? Thanks :slight_smile:

I tryed to add the click event to the Level Blueprint.

Just a simple test that when I click on castle model, it prints text to the screen.This example worked on my other test project with top down template.

Also a in game pic, if it may help:

In game I can also use regular mouse cursor(not seen on pic), but the game also shows the first person template crosshair cursor(maybe this somehow denies events, I don’t know :D). I hope this is the additional information you need.

Alright so first of all… handling user input inside of your level blueprint is in the very large majority of cases bad practice.

You should handle events inside of your controller or at least character. Those also accept input by default. This is especially important once you go into multiplayer games as all players have the same level but all have different cursor locations. It is possible to enable input. If you go into the “Class Defaults” (directly left from the “Play” button when you have your level blueprint open) you can set “Auto Receive Input” from “Disabled” to “Player 0” (which will select the first player connected to your game… in a single player game simply your player). This will enable your mouse input.

As I said. I would recommend handling those inside of your Player Controller.

Cheers

Let me save you some time, it will be easier to do with linetracing: http://imgur.com/a/t3T1j
This is what I did, took me a whole day to give up on default mouse events and make my own thing…

1 Like

Hey Vlady, got a question. I’m trying to make a Myst-style game and from the videos you showed it seems that your method would be the best way to go about it. I’m trying to do it with splines though so that when the player looks in the direction of a spline, the spline “activates” and they are able to go down that path. I have a question though. In your blueprint you’ve got two event ticks and for whatever reason I am only able to use one. Anyway to remedy this? Thanks.

Could do everything one after the other in the same tick using the “sequence” node?