It might be a little confuse. So there’s this actor I created called “Drink”, and what I want to do is Click the cup to DESTROY! and yeah, the blueprint was worked, here’s what is looks like
But here’s the problem. I found out that when I clicked somewhere else, it transfer me to the next level. I know there’s a thing called Enable/Disable input but I don’t know how it works. I just want to click at the drink only. Please help
I actually I don’t know about blueprints much, even tho I use UE4 for almost 4 years…
It’s because you’re relying on mouse click. You can click the mouse any time you like!
Only allow the mouse click when the player is in a collision volume near the object
This will still mean that the mouse click works when the player is NEAR the drink. If you really want to nail it down, you have to adopt the classic method which is line trance and blueprint interfaces.
The problem is your current setup destroys the cup even when you don’t click on it.
This setup works. Put this in either the player controller or character blueprint!:
Note: Since the hit result function is a pure function, it may run twice (since it’s accessed twice), so for performance reasons, you can set the hit result to a variable before using it so that the trace only happens once.