How to play animation when player clicks an actor?
I already have the animation ready, i just don't know how to play it when player clicks a cube.
asked Jul 01 '18 at 06:55 PM in Blueprint Scripting
Have you tried using an "on clicked" event? You can create one of these by selecting your Cube mesh component in the BP and at the bottom of the right hand details panel there are a bunch of green "+" signs one of them is for an "on clicked" event.
answered Jul 01 '18 at 08:05 PM
Nebula Games Inc
You should do this in 2 steps. Firstly, create an intractable area into your cube BP Like a sphere, in which your character will be able to interact with the cube. Then just share a variable between your cube BP and your character one, thanks to the "get play controller" and "cast to third person ch" nodes. Then if your character is in the collision box/sphere, you should use an input event. On press, just check if your character is in the collision box, if true, set another variable to true like "play animation", and then you can cast it from your anim BP. You'll just have to get it in there and to use it as a transition to a new state, which will play your interaction animation. Let me know if it helps :p
answered Jul 01 '18 at 09:35 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here