In the blueprint tutorials, when player overlaps two trigger boxes of identical blueprints that activate input to toggle, input only works for one. Why? How to make both work at same time?
Just starting out with UE and I'm going through the "Introduction to Blueprints" tutorials. Just finished no.7 https://docs.unrealengine.com/en-us/Videos/PLZlv_N0_O1gY35ezlSQn1sWOGfh4C7ewO/EmvekeKk-0o where I have to make a blueprint of a light fixture that has a trigger box. When the player enters the trigger box, a prompt to press "F" to toggle the light shows up. Pressing "F" while in trigger box will then toggle light.
All is working fine, but I noticed that because I have 2 of these light fixtures in my level in close proximity, my player can overlap the trigger boxes of both at the same time. When this happens, pressing "F" only toggles the light attached to the trigger box I entered last (and when I leave that last trigger box but remain in the first trigger box, then I toggle the light attach to the first trigger box). Why does this happen and how can I make it so both are toggled? It's more than anything just to learn a bit more about how blueprint and UE work.
This is a screenshot of the event graph I made by following the video, though I made minor changes that shouldn't affect this.
asked Aug 06 '18 at 07:31 AM in Blueprint Scripting
i feel like this is all being over complicated. your lights are all made as a actor and you are just creating many instances of the one actor right? if thats the case and your overlapping two actors at once and you want the input to affect both at once then theres a simple solution, select the F input event then go to the details panel and uncheck consume input. that should solve your issue by allowing multiple actors that have the same priority to use the F input at the same time.
Huge mistake on my part - This would be right if you were storing the lights in the character.
Try one last thing:
Please select the input event "F" and in the "details" tab make sure that "Consume Input" is not checked.
You are using (and storing) a single SpotLight variable.
This means that you set it once and then override it with the next set node. This way you are storing only the last object you have set.
In order to start/stop multiple lights you should convert this variable to an array and on KeyPressed F you should loop through the array and toggle the visibility of all of them.
Follow this question
Once you sign in you will be able to subscribe for any updates here