In my project I created a blueprint class with various components, and I want it to throw an event whenever the user touches one of them (or simply when the cursor is over them).
I tried some “BeginCursorOver” or similar events, but nothing seems to happen (I already created a custom PlayerController with all events from mouse and touch enabled).
What could I do?
Sound like you’ll need to use an onhit event, rather.
Thanks for the reply.
I’m new to Unreal, so maybe I’m missing something obvious, but with “touch” I mean with a touch screen. The game should have a static view with some composite elements that can be moved with a finger, like a slot machine with figures above a tape which can change dynamically. I want that structure to become aware of being touched so it can spin in response of a movement of the touch in the right direction.
From what I’ve read the Hit functions are made to manage the collision of bullets and other objects, isn’t it complex to use them for my purpose?
Silly question, have you hooked up any inputs?
I’m not sure about your question.
I have enabled in my PlayerController all mouse and touch events, and I managed to make the structure move when I click and drag one particular object of those that are attached to the spinning tape (at the moment the tape and the objects are all components of the same Blueprint Class, in the future I’ll look for better solutions).
Does this answer your question?
Yeah that answers it I believe. Could you provide a ScreenShot of the code?
“Sphere” is one of the components of the structure and also the actual root (I will replace it with some kind of plane).
For the operations on X and Y axis I tried to convert the mouse position from screen to world but it seemed too tricky, so I simply treated the X axis on the screen as the Y axis in the world.