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"

Hit Result Under Finger returns False

Hello,

I am new to the Unreal Engine and i am currently on a project for an Android Game. I want to find the collision UV of an object but i can't seem to get a result from the function "Get Hit Result Under Finger For Object". I tried with the "For Channel" function but still the same thing. I tried adding all the available pins to the Make Array node but still to no avail. I tried passing the finger index from the Input Event but still nothing. I also tried another approach for PC, using the Line Trace for Objects and it works perfect but with the Touch i can't seem to get it to work.

The execution always ends up on the Print String function.

As a side note: i have successfully set up other things like, pinch to zoom and rotating around an object using touch. I believe i have googled probably all similar issues that is why i am posting myself :S

Thank you in advance, Kevin

The attached screen shows how i am currently keeping it, using the For Object version.

Product Version: UE 4.20
Tags:
prototype.png (98.2 kB)
more ▼

asked Dec 06 '18 at 10:06 PM in Blueprint Scripting

avatar image

KevinPlease
3 1 3

avatar image supaflakes Dec 07 '18 at 12:55 AM

Which channel did you use in your for channel? Did you try the visibility option?

avatar image KevinPlease Dec 07 '18 at 06:40 AM

I did try the Visibility and also Camera just to be sure. My object is visible and has Block All collision. I will post a screenshot of my BP when i get back from work sorry.

avatar image KevinPlease Dec 07 '18 at 08:55 PM

Ok, i edited the question by adding the screenshot attachment.

avatar image supaflakes Dec 07 '18 at 08:59 PM

Ok, thanks for the screenshot. Can you try selecting the world dynamic instead of world static?

avatar image KevinPlease Dec 07 '18 at 09:00 PM

I have tried making the array with every listed element in it, altogether, and it still won't work :/

avatar image supaflakes Dec 07 '18 at 09:07 PM

Hummm. Can you try the for channel and select visibility? Then in the collision preset of the blueprint you want to hit, instead of choosing the block all collision, select custom and select "block" for the visibility channel.

avatar image KevinPlease Dec 07 '18 at 09:15 PM

Ok, so i tried it, got the screenshot of the collision settings i tried for the object. I also tried adding new sphere, cube and it's still the same thing, i can't get the trace working. I tried by checking all collision channels, objects - and by simply checking the visibility channel as shown below. I am starting to think it might be a bug with UE? Probably just for my case though cause i've seen others that have got it working :S

alt text

collision.png (24.1 kB)
avatar image supaflakes Dec 07 '18 at 09:20 PM

Can you add a break hit result to your get hit under cursor and print the blocking hit boolean?

avatar image KevinPlease Dec 07 '18 at 09:35 PM

Alright, using the Get Hit Under Cursor For Channel and breaking the hit result : Blocking Hit returns true when i click on the object and false when i click on the skysphere - ideally as i want it The same also with the For Objects version using the cursor, i am just surprised because touch events properly work and are differentiated between tap and touch to rotate so it's all good there.

avatar image supaflakes Dec 07 '18 at 09:57 PM

Ok so did it answer your question or do you have another one related to this topic?

avatar image KevinPlease Dec 07 '18 at 10:07 PM

Well the function for which this works is called Get Hit Under Cursor For Channel, so i am guessing it will not work on a mobile device right? As i mentioned in the question, using the cursor the trace works perfectly, but the functions Under Finger don't work :S. I will test on a real device though as soon as i can and will get back to you, if the Under Cursor version works for touch events too.

avatar image supaflakes Dec 07 '18 at 10:10 PM

Oh sorry I did a typo when I wrote "under cursor" earlier. I meant "under finger" lol Can you try doing the same thing (breaking the hit result and showing the value of the blocking hit boolean) with the under finger one?

avatar image KevinPlease Dec 07 '18 at 10:17 PM

Lol i did think about the possible type there but i thought you were trying to verify that my cursor works :P As for the break result i have tried that before also and it returns false - and the hit actor, component return something like NONE, NULL i don't remember the term correctly

avatar image supaflakes Dec 07 '18 at 10:20 PM

Oh I see, if that's really the case, then maybe your problem comes from your controller which is null itself. Maybe you should try putting it outside of your function for testing purpose.

avatar image KevinPlease Dec 09 '18 at 02:21 PM

I tried putting the function outside still the same problem - i also checked with Is Valid node targeting the Player Controller and it returns true so i guess no problem there. I was thinking maybe there is some sort of setting i must change on my Project Settings perhaps? Just thinking about it :/

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

1 answer: sort voted first

SOLUTION:

Ok so i managed to find the problem. So the issue was that the function Get Hit Result ... should be called immediately after the input event, in my case after the node Input Action Finger for example. What i was doing in my blueprint was that i was adding a delay after the Input Action node for other reasons, and then calling the Get Hit Result function node.

Apparently putting the Get Hit Result function node right after the Input Action node fixed the issue and now i get a True Hit Result. I do have issue Finding the UV Collision now since it is returning false but i will look into that before asking help again :S

Thanks.

more ▼

answered Dec 09 '18 at 09:49 PM

avatar image

KevinPlease
3 1 3

avatar image supaflakes Dec 09 '18 at 09:52 PM

That's cool! Sorry I couldn't help more. Anyway, glad you found the answer ;)

avatar image KevinPlease Dec 09 '18 at 09:53 PM

I really appreciate the help either way, and your patience bro :) You still helped me keep in my mind common things i should debug in cases like this :D Thank you!

avatar image supaflakes Dec 09 '18 at 09:54 PM

Cool! have a great day! :D

(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