How do I make an object disappear when I click it using a mouse?

I had already set up a show mouse cursor but I want it so that when I click a specific object it disappears and gets added to the counter HUD.

The object needs to be a blueprint.

In the level BP:

In the object BP:

click

You might need to re-post to get the widget part, it’s a lot in one question.

Hello. Thanks for the reply. I tried it but it doesn’t seem to disappear when I press the object. Does it work on Paper Sprite Actors?

It works on any BP. Can you show your BP structure?

I just tried it with a sprite:

image

Sure! Here it is.

Object BP:

Level BP:
Screenshot (538)

The level BP is connected to Event BeginPlay.

Works for me :clown_face:

Actor clicked is actor clicked ( sprite or no sprite ).

I don’t have any other code, I don’t get it…

Do you see the mouse cursor ( it’s like you lose control of the camera )?

Do you see the mouse cursor ( it’s like you lose control of the camera )?

I do, yeah.

I’m using a 2d side scroller level by the way, if that factors anything in.

Ah. Are you definitely getting to the object?

There may be something in the way ( collision wise ).

Nothing really. I tested it on a different area and it still doesn’t work.

I’ll try it on a different object and see if it works.

Ok I just tested it out on another object and it works. For some reason it doesn’t work on the other one.

:thinking:

It works! Finally! Found my way through it. Thank you very much.

:upside_down_face:

Very helpful thanks

1 Like