x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Product Version: Not Selected
Tags:
more ▼

asked Mar 16 '15 at 05:55 PM in Blueprint Scripting

avatar image

Vishnzen
1 1 2 1

avatar image Erasio Mar 16 '15 at 09:39 PM

Where are you trying to add the on clicked event?

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

avatar image Vishnzen Mar 16 '15 at 10:10 PM

I tryed to add the click event to the Level Blueprint. Test event 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: Test in game footage 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.

in game.png (1.2 MB)
(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

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

more ▼

answered Mar 16 '15 at 11:08 PM

avatar image

Erasio
5.9k 291 86 293

(comments are locked)
10|2000 characters needed characters left

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...

more ▼

answered Oct 30 '16 at 01:53 PM

avatar image

Vlady Veselinov
53 2 9 8

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question