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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Why is OnClicked for my BP object working differently when mouse cursor is shown and when it is not shown?

     So I have made a BP for a desk object to turn off/on when you click on it. When I set the show mouse cursor in my BP for the player controller, I can click on any part of the desk from any distance and it will turn on, but I do no like that I have to click and hold down the left mouse button to move the camera as one problem. 
     The main problem is that when I disable the mouse cursor I get the small red crosshairs and can move the camera driectly corresponding to mouse movement but for some reason the BP for the desk object becomes very specific where on the object you have to click on it to turn on/off. Why is this?
     I have a picture below showing the that is roughly the area of where I have to click with the crosshairs. I want to be able to click on any part of it and turn it on from a distance with out setting the show mouse cursor in m BP for player controller.

![alt text][1] [1]: /storage/temp/16787-screem_off.png

Product Version: Not Selected
Tags:
screen_on.png (1.6 MB)
screem_off.png (1.3 MB)
more ▼

asked Oct 01 '14 at 10:08 PM in Bug Reports

avatar image

ddtapia
43 5 8 11

avatar image Jonathan Dorman STAFF Oct 02 '14 at 01:42 PM

Hey ddtapia.

How are you registering whether or not you are clicking on the desk? Are you using a raycast? It would help if you could show us your blueprint.

avatar image ddtapia Oct 02 '14 at 06:46 PM

Hi Jonathon,

I am watching the blueprint as seen below when I am play the level in the editor.alt text

desk_bp.png (124.1 kB)
avatar image Jonathan Dorman STAFF Oct 02 '14 at 07:07 PM

How big is your collision box/capsule/etc for the desk? OnClicked checks to see if you've clicked on the actor's collision box, so the main reason you'd only be able to click on that small area would be a tiny collision box (or one that is extremely offset from the mesh it's attached to).

avatar image ddtapia Oct 02 '14 at 07:19 PM

This is a picture of the collision for the static mesh i am using for the BP. Is this what you mean?alt text

avatar image Jonathan Dorman STAFF Oct 02 '14 at 08:12 PM

That collision box looks fine. That means the problem must be with the way you're hiding the mouse cursor. Can you show me that blueprint?

avatar image ddtapia Oct 02 '14 at 08:24 PM

Oh ok. Well I am not using any actual blueprint. I am using the basic MyCharacter BP for FPS. I have a BP for my player controller but all i do is just simply have the 'Show Mouse Cursor' disabled.

avatar image Jonathan Dorman STAFF Oct 02 '14 at 08:37 PM

Oh! Okay, I've managed to reproduce your situation now. I'm looking into the issue.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey, ddtapi,

I want you to try something for me! While you're in your game, hit the Windows Key (or shift+F11). That'll make your cursor visible again. You'll see that the cursor usually isn't in the center, where you expect it to be.

The reason is that 'hide mouse cursor' literally just hides the mouse cursor. It doesn't 'hold' the cursor in the center of the screen, which is what you'd expect when you see the red crosshair and don't see the mouse. So when you see the crosshair over the desk, the mouse is probably off in the corner of your screen somewhere. That's why it doesn't work when you click.

That means, rather than the OnClicked node, you should do a Line Trace whenever you click Left Mouse Button. If the Line Trace collides with a Desk, then the desk is turned off or on. I think you'll find that fixes your problem neatly.

Regards,

Jonathan

more ▼

answered Oct 02 '14 at 08:58 PM

avatar image ddtapia Oct 02 '14 at 09:02 PM

Hi Jonathon,

Thank you I will try that! That makes sense though.

  • Deelan

avatar image ddtapia Oct 03 '14 at 05:28 PM

Hi Jonathon should I use a LIne Trace by Channel or for Objects?

avatar image Jonathan Dorman STAFF Oct 03 '14 at 05:54 PM

Both work, with some small differences. The description you get by mousing over the nodes:

For Objects: Does a collision trace along the given line and returns the first hit encountered. This only finds objects that are of a type specified by ObjectTypes.

By Channel: Does a collision trace along the given line and returns the first blocking hit encountered. This trace finds the objects that RESPOND to the given TraceChannel.

avatar image ddtapia Oct 03 '14 at 09:24 PM

Thanks Jonathon! I got it working now with the help of some Event Dispatchers too! I appreciate the persistent help, keep it up!

avatar image Jonathan Dorman STAFF Oct 03 '14 at 09:31 PM

I'm glad to help!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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