OnTouch event

I created a third person shooter with starter content mobile project.

I have an actor “target” which only contains one static mesh. I use the “OnInputTouchBegin” event to destroy that mesh. In the game, I spawn that target, but I only can touch and destroy it when it’s close to my character (the distance is about 1000-3000 units, but sometimes i have to go up to about 500 units to that mesh to destroy it). When the mesh is farther away, I still can see it pretty good but I can’t touch and destroy it. (I can upscale the mesh 100 times so there would be no problem seeing that mesh, but I’d still have to go closer to be able to touch it).

Sometimes I can touch and destroy the target, so the problem isn’t in input settings, I believe. I’ve also set the collision of that mesh to “block all”. It seems like I am missing some world or project settings option, which would allow me to select farther object.

So is there any way I can touch the target that is placed in some distance from my character? Or is there any trick i can use to go around that problem? I want to just have an ability to destroy any mesh i can see.

I think I located the problem: it seems that I can’t touch the target that is positioned lower (z value is lower) than the position of my character and the distance to the mesh doesn’t play a role.
But I still don’t know what to do.

Hello neutral_evil,

I was unable to reproduce this issue on our end. I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in a clean project?
  2. If so, could you provide a detailed list of steps to reproduce this issue on our end?
  3. Could you provide screen shots of any blueprints/settings that may be involved with this issue?
  1. Spawning a sphere on a clean project and adding an “on touch” event doesn’t cause any problems/errors, so must be a problem with my blueprints.
  2. I spawn the Terrain in game mode blueprint, tell me if i need to post that too.
    Set Spawn Areas function just composes some collision boxes into an array.

110602-targt.png

1 Like

I would suggest taking a look at the blueprint where you are passing in the actor component that is to be destroyed to make sure that when the event is called that a valid target is being passed in.

Hello neutral_evil,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.

Thanks,

Sorry for the inconvenience, I found my problem. A collision box at the end of my map tile was messing with my input (it was set to have a certain height from the ground, so that occurred to me that i can only hit a target that is placed higher than my character). Again, thanks for the help.