How do i click a static mesh and turn the player torwards it?

I’m just started using this program and have been searching everywhere for a tutorial for this. What I need is to be able to click an static mesh and then face that mesh. I do have a player controller with the mouse events activated. I guess my main problem is getting the mouse events to work. I have seen a few tutorials and I can get a simple click to work, but not by clicking a specific mesh. Thanks

What you can do here is make use of a node called ‘Trace hit under cursor’ (or a similar name). This node will return the Actor that is under your mouse cursor. So on the click event, you will call this node and get the Actor that is under the cursor. Check and make sure this Actor is the object you are looking for. You can then get its position and rotation which you can use to rotate your character.

Another option is to create a special blueprint for your ‘clickable’ meshes. You can add a click event directly in its blueprint, which will fire up when you click an instance of this blueprint. Then you can set the characters position/rotation.

if all the meshes in your level are clickable, go with the first method. IF there are only a few special objects that are clickable, go with second method

Thanks that really helped. I got it working now with everything except if I wanted an clickable event with a skeletal mesh. I applied the same technique. Looking for a little insight as to why. Thanks again

What is the issue you are having with skeletal meshes?

Basically here is what I have now. I can click a cube mesh and press the W key and fire a projectile at it. Everything is working perfectly. But if I apply the same method to a skeletal mesh(heroTPP), I get no response when I click it. I am using the same exact technique as I did the cube mesh. Not sure why it’s not working. Note: This is from the 3rd person template and I copied the skeletal mesh from the mycharacter mesh.

Does you skeletal mesh contain a collision volume? Because if it does not, it wont be able to detect click, traces or stuff like that.

First, thanks you have been a huge help for pointing me in the right direction. Second, no it does not look like the skeletal mesh has a collision volume. After doing some research on collision volume I am unable to find a way to add a collision volume to my already existing skeletal mesh. So I seem to be stuck for the time being. For now I will continue to research and play with it. I do a lot of trial and error. Maybe with luck, I will get it :slight_smile:

You will need a Physics Asset. You can set up those in Persona PhAT and they will define the collision volumes for the skeletal mesh.

Take a look at this:

and

I got it! It is finally working! Thank you so much!

Awesome!

So how did you go about it? Added physics asset to your skeletal mesh or simply added a capsule component to the BP that is using the mesh?

Capsule component made more sense for the situation. Thanks

Ah, ok!

BTW, could you mark the thread as solved?

Thanks