Enable movement and change material of an object by pressing a single key

Hello,
I am trying to make it when you start the game you are unable to move or look around until you have pressed specific key (in this case is “E”) and the same key beside enabling you to move around and look around at the same time will change the material of an object in the scene.

The blueprint that I used for the material change is this:


The interface activates the interact input which is set to “E”

Thank you in advance :slight_smile:

Try this if your blueprint is not a PlayerPawn:

My Products

This does the opposite. At the start I have control but when I press it I loose control, what I am looking for is being unable to move and look at the start but be able to press the “E” key and by pressing it get the control.

I guess I’m a bit confused about this. Why can’t you just directly hook in Enable Input and then set material node one after the other into the pressing E event?

Is there a special case of some sort?

Edit: Oh, I get it now. Because the input is disabled. Maybe instead of disabling/enabling input, just don’t have a mapping context set up and then have the E key just add a mapping context. (assuming you are using 5.1)

Edit again:
You can use these nodes to remove and add mapping contexts. (assuming 5.1) Then you just have to put the actions you want your character to have in the mapping context and add it or remove it as you like.
MappingContext

2 Likes

You can disable it on start:

This is how I did it tanks to Detach789


This is in the BP of your character that you use^

This is in the BP for the object that you want to change the material

can you edit your comment with the images that i posted so i can mark your replay as the solution