Download

Trigger firing

Please explain how to implement the disappearance of the floors of the house when the actor passes to a certain point, in this example, into the trigger. It is necessary that when entering, objects of the house disappear. As I understand it, there should be two triggers. One in front of the door, the second behind the door. When entering the door, parts of the floor disappear, and when leaving the floor, they appear again. Or how is it done in games? Am I thinking right? I can’t figure out how to change this level blueprint to make it work.

Your idea is more than fine.

Rather than dragging the reference into the BP, select the trigger in the World Outliner and then:

image

This gives you the event.

Just do note this belongs in the house actor. Avoid LB for scripting such behaviours. If you encapsulate this logic in a house actor, you can then plop down 10 houses in any level and all of them will work the same way, rather than duplicating script in the level.

It will also simplify communication further down the line.

Consider this being the house actor:

Entering / leaving the trigger can show / hide everything that was attached to the floor via propagation flag.

Now the whole house needs to be recreated

Is there some way to add existing objects to the blueprint? In order not to remodel the whole house?

There are many, many ways to organise it. I mean, you can just have things scattered as they are, manually add them to an array and then:

Or use tags; tag all components in the house that belong to a group, and then:

In both instances it does not matter who is where and each house can have a different set of components.

Tags may be more flexible here. Let’s say you want hide all windows on all floors - get all components with the desired tag.


Or imagine you want to hide all sofas in the house that aren’t blue:

Sofas with no Blue tag will become hidden.

Haha, this sounds like a story of my life / dev experience. There’s always a quirky hack-around to whip things into place, though.

If you’re thinking you will not need to reorganise what you’ve got now, think again. The more experience you gain, the more you realise how bad the stuff you had designed is. Really hoping to reach a plateau where I can look at something I made a year ago and finally be proud rather than mildly embarrassed…


While you are here, can you explain to me why the node does not work by pressing the enter key? Without the pushing node, everything works fine, the door opens upon contact, but if you connect the press of the enter button, it immediately stops working. It works with a false, and another node, pressing the enter, causes problems.

The component Begin / End overlap triggers when something Begins or Ends overlapping them. They trigger once and only when the above action happens. It is not a continuous action. Those 2 event will not retrigger because you hit Enter.

The above would work if you held enter down and then walked into or stepped out of the trigger.

Atm when the overlap happens, it checks with the Player Controller whether input key is being held down. If it’s not held at the precise moment of overlap, that Branch will return false.

If you want to trigger on key press, you’d need to approach it differently. Could you describe a theoretical scenario of what needs to happen when enter is pressed - from the the player’s point of view. We walk around (the house?) press enter and then what?

Generally speaking, interactions with the environment should be scripted in the pawn / player controller - there is a reason why input is disabled on regular actors. Under most circumstances, if you wanted to check what the player is overlapping, you’d do it in the player BP:

This will return all actors / component overlapped by the sphere collision attached to the player. You could then filter what you want with a tag.

But again, it’s hard to advise precisely as I’m not sure what the end goal is.

all the darkness of the map disappeared somewhere after the house was remade. Previously, nothing was visible under the roof, but now everything is lit.
as if there is no roof!

I accidentally deleted the sun light blueprint
So what’s now? How to get it back?

I unchecked allow static lighting and after that I can’t load the project at all
Stopped at 39% and that’s it