x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to trigger volumes with widgets?

I am trying to figure this out. So I begin overlap with a point light followed by a trigger volume so when I walk into that trigger volume it shows up a widget that says "Press "F" to start toggle" and then you press F and it turns off the point light. I got this far. But the problem is, is that I can be outside of that trigger volume and still press F to toggle I want to be inside that trigger volume for the effect to work. How would I go about doing this?

Product Version: UE 4.21
Tags:
more ▼

asked Apr 22 '19 at 06:29 PM in Blueprint Scripting

avatar image

Austin Searle
1 1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Check if you're overlapping the trigger volume when pressing F.

Am I right to assume this will get more complicated since you'll most likely want to do more with the F key later on, rather than just turning lights on/off?

more ▼

answered Apr 22 '19 at 07:18 PM

avatar image

Everynone
13.8k 74 25 57

avatar image Austin Searle Apr 22 '19 at 07:21 PM

How would I do this? I tried branch nodes and booleans I am a newbie to blueprints and I am starting out with point lights trying to understand how this works and coming up with random things to add to the lighting effect. If you can give me an working method that would help out alot

avatar image Austin Searle Apr 22 '19 at 07:29 PM

Yes it is ok to assume that. I forgot to mention that this project is to practice blueprints not to develop an actual game. I'm just trying to learn blueprints.

avatar image Everynone Apr 22 '19 at 07:46 PM

There's half a dozen ways of doing what you need. Here's the most straightforward implementation I can think of:

The actor (triggeredLight) has a trigger box, a light and a custom event:

alt text

I placed 2 instances of that actor in the level:

alt text

And the character can interact with any number of those actors like so:

alt text

Image from Gyazo

The F only works if you're actually overlapping at least one of them. Otherwise the cast fails and it's OK to let it fail.

edit: do tell if something does not add up!

level.png (607.9 kB)
3rdp.png (209.8 kB)
lighttr.png (272.5 kB)
avatar image Austin Searle Apr 22 '19 at 07:49 PM

Thank you so much. Was I doing it wrong by trying to do it within the level blueprint?

avatar image Everynone Apr 22 '19 at 08:00 PM

It depends.

In this situation it's the character that is responsible for the interaction so I'd keep it all in the character. Especially that player keyboard input is involved.

If player stepping into the box were to trigger opening of the door (another actor) somewhere in this level, I'd place the script in the Level Blueprint since this behaviour is unique to this level only.


Imagine what happens with the F interaction (the lights you flip) once you to go to Lvl 2. You would need to write the interaction code again for this level... and every other level you may have. By keeping the script in the character, you get to interact with whatever you encounter, friend or foe, and wherever it is.

Hope this makes sense.

avatar image Nancy Dane Apr 24 '19 at 05:47 AM

I am feeling acknowledged this time because I really don’t know what widgets are and how to trigger system volume with them. Now my biggest concern is that, why don’t I have this sitejabber earlier. But so far so good, good things happen late and still they feel very great. Anyways thanks a lot for sharing this information and I hope soon your problem will be solved.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hi there.

Have a look a this.

Create an Action Mapping in your Project Settings -> Input I set my to P and named it InteractUse

https://imgur.com/a/CxqK00O

PS. On Component End Overlap (Box) New Visibility should not be ticked. In case you have added text.

Made a quick video to show the end result:

https://www.youtube.com/watch?v=PMv93PvvsG8

Hope it helps.

more ▼

answered Apr 22 '19 at 08:08 PM

avatar image

DonBusso
66 4 4

avatar image DonBusso Apr 22 '19 at 08:25 PM

You can add a Cast to your character when you Begin and End overlap (Box) so that only you can operate the switch, otherwise if any other actor walks into the trigger box you will be able to switch the light on and off.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question