Get hit result under cursor (hit component) returns wrong component

hi guys.

first of all i’m using 4.9 and have a Class added some meshes into it.
i’m trying to get mesh names by hit result under cursor(break result and get Hit component). only a certain point on screen gives me the right mesh name and others return invalid mesh names.

also for making sure that hit results work i tried Spawn an emitter on location of hit point and it spawns at the right spot.

Thanks.

Hello Cgraider,

I wasn’t able to reproduce the issue that you are having. Have you left out any details that might help us reproduce your issue? Also, if you could set up a new test project and provide us with a zipped up file that includes the project, we could have a look at exactly what is causing your error.

One thing you can try is to have a look at the collision on your components. It may be that one of the components has a large collision which is causing the error of it only returning the correct mesh name at a certain point.

Regards,

Sean Flint

thanks Flint. here is more info :
1.i have a widget that i added it to viewport @EventBeginPlay
2. 3 Character(camera) instances in Level and made an array to send the reference to Widget BPClass . from the widget class i change between Cameras(characters) with SetviewonTarget(also i did a test for using posses after SetViewOnTarget , Didnt work)
what i tried to do is adding a tag on some Meshes. after i get component hit result i checked tag equals to value i want which only the Yellow Painted Part Gives me the Value(issue2.jpeg).
also i did a simpler version to check the ComponentHit name which it returned the Static mesh component name outside of the BPclass,(inside BPclass mesh name is different)

the whole point of this is detect Mesh components and material and change it.
i’ll test this in new project ASAP, have so many BPs :expressionless: .
Thanks again.

Hello Cgraider,

Your blueprint looks to be done right, as I have mine set up the same way and it is working without any issue. It could be an issue with the mesh itself, so if you could include your test project or at the very least a screenshot of how your mesh’s components are set up, we can have a look at that.

Thanks,

Sean Flint

Hello Flint

i Finally managed to find out whats going on. i deleted all the scene components one by one and it seems i had a object on top of it that i hidden it on Editor. also other objects in the class caused the problem too( i checked visible off on them before) after removing those it works.

is there any way keep them invisible and not cause this problem?

Thanks.

Does it need to have collision? Because otherwise it’d be a valid options to just turn off collision.

Hello Cgraider,

I am marking this thread as resolved, as I have not heard from you for a few days. If you have any further questions regarding this topic, feel free to reply to this thread. If you have any new issues please create a new AnswerHub topic.

Thanks, and have a great day.

Sean Flint