How to turn on visibility when you press a key?

I want to be able to look as if I have placed a jigsaw piece into a puzzle by simply making it appear when you press a key. I currently have the jigsaw in the position that I want it to appear I am just unsure on how to code it so that when you press the key it goes from being invisible to visible to look as if it has been placed in the jigsaw. Thanks.

Thankyou for you reply. It is a blueprint so I have just tried to do what you said but it still isn’t working. Do I need to include a collision box for it to work? Sorry I’m new to Unreal so I don’t know a lot.

Yes I’ve only done what you’ve said though so there’s not much on it haha

Just get a reference to the actor or component and call the node Set Visibility with the parameter of false.

The key input you can easily google to set up. There are so many tutorials on that.

HTH

Is your jigsaw piece a blueprint? If it is do this:

  • Press a key node → Toggle Visibility node

Connect self as the target.

Is your jigsaw piece an actor on the map? If it is do this:

  • Open Level Blueprint → Drag a reference of the jigsaw puzzle to the level blueprint → Press a key node → Toggle Visibility node

Connect the reference actor as the target

If you can’t see the toggle visibility drag it from the self reference or the Drag and dropped reference.

May I see your blueprint?

Ohh you’re using the wrong node try this node:

137204-this+is+the+proper+node.png

Ok I’ve changed it to this key instead and when I tried to compile it it came up with an error so I’ve attached the target to the jigsaw but this still doesn’t do anything when I play the level.

Can you try attaching the Jigsaw 1 straight to the toggle visibility?

No it just automatically inputs the target to default scene root 1 code

Can I see the whole blueprint including the components tab.

This is it.

Thankyou I will try when I get back from work and if it doesn’t work I will post back on here.

This is it. Thankyou for you help

Is the pCube8 and the typeMesh1 the things you want to toggle visibility or at least one of them?

Yes it is both of them as they both make up the jigsaw piece

Get the reference to pCube8 and typeMesh1 and create two toggle visibility nodes and attach them as the targets.

Sure just leave any questions here and I will answer as soon as possible.

Hello, this is what I have now done but it still doesn’t work. Do I need some kind of collision box around it so that you can only place it when you are in that area?

Are you controlling the blueprint of the jigsaw puzzle or you have another character?

If the jigsaw puzzle is not your character do this:

  • Open your level blueprint
  • Drag your jigsaw puzzle to the level blueprint to create a reference
  • Put the Press R node
  • Pull the toggle visibility node from the referenced jigsaw puzzle
  • And connect it to the Press R node