I have this simple setup where I wish to test if I can trigger mouse hover effect on a Actor.
After reading posts regarding this topic I came to the following code. AUnitBase is a Pawn Class, I create a StaticMesh component and assign OnBeginCursorOver to trigger a function. Like so
Then In editor I have BP class based on AUnitBase and its in game area. I press Play in editor and then try to move mouse over this static mesh but nothing gets logged.
What else do I need to do to make this work ?
Hey @Ettu_R, welcome to the forum community!
I believe you have to enable clickable in your mesh component. I found another forum question that might help:
Thank you for reply @ZenLeviathan
I managed to get it working, sort of …
What I did was create a custom PlayerController for my PlayerPawn. Then in that controller I added
So now mouseover works. However, as I’ve read it will only work on StaticMesh ? I tried to add this to SkeletalMesh and that does not trigger mouseover ?
Is there any way I can make it work on SkeletalMesh ?
I have this dragon, which is animated and that I would like to have mouseover effect on. How can I make it so that mouseover works on that dragon ?
I made BluePrint from this C++ class and inside BluePrint, when I look at SkeletalMesh component, there seems to be possible to register mouse events. I added one like so
I think I figured it out! I changed collision preset on SkeletalMesh to “OverlapOnlyPawn”, which I believe now triggers mouseover from my PlayerPawn. Seems to work as I wanted
I have a situation I dont quite understand comparing C++ / BluePrint.
I have C++ baseclass and BluePrint made from that base.
When I try to make SkeletalMeshComponent to trigger hover effect through C++ it wont work, so the following code wont trigger
But if I got to blueprint, select SkeletalMeshComponent and manually set Collisionchannel to only overlap Pawn and add OnBeginCursorOver event through blueprint, it will work.