how do I use the same input key for different events happening in the level?
I have searched far and wide for an answer but haven´t really found what i´m looking for. So my problem is....
My level contains a lot of statues and I want the player to be able to go up to a certain object and press E. And when the player has pressed E a text pops up with info about this object. The question is, how can I use the same key multiple times without all the texts appear at once?
Can I use DoOnce in some way and tell it to be able to press E? Or if I disable the E input anywhere in the level and only allow the player to press E when entering certain areas (with triggerboxes)? I also read that creating an Blueprint Interface could allow me to create a function for this? I don´t understand how it works yet though. Another thing I considered was using arrays? You understand my confusion? ;-) I guess there are many ways to solve this?
asked Aug 07 '18 at 09:52 AM in Blueprint Scripting
You're quite right in saying that there are many ways of doing this.
I've placed some statues around the level - the statue is an actor with a cube that can simulate physics, there is also a Text Render.
The third person character has Sphere collision (made visible in this case) and the following script:
If you need to be more precise and only interact with a statue that the players is looking at directly, you will need to linetrace ahead of the player and check whether there is a suitable object close by.
Follow this question
Once you sign in you will be able to subscribe for any updates here