Download

Sink Walls Near My Character

Hey, so I want walls that my character walks behind to sink down into the ground so that I can see my character again (instead of making the walls invisible). So far, I’ve got a Socket on each mesh that I want to sink down called Sink, and that is where the mesh should sink down to (though for some reason it sinks a little higher than the socket, so I have to have the socket lower) so that the top of the mesh is still visible. Next, I have a tag on each mesh/BP defining it as a Wall, so that only wall tagged meshes will sink down. All of that is working… except for the part where it only affects things that have the wall tag on them, cuz it likes to affect some meshes, including my player object, and what it decides it is ‘overlapping’ is kind of random…

I have even gotten the BP working if I put the BP onto the mesh itself, though that only runs off of the begin play event, not the overlap that I want.
SinkWall2TestMeshBP.jpg
Another issue is that unless I set the root location and socket location as a variable at the start, the mesh just keep flying off forever. Ideally, I want to set this BP to be within the character BP so that I can have my overlap event for the box that is attached to behind my player to be able to trigger the sinking action for each object, though if I need to put a lot of the BP in my walls and have all my walls be BPs instead of just static meshes, I’m fine with that. Here is the BP that is in my character.
SinkWall2PlayerBP.jpg
And here is the Box that stays behind my character that should trigger the overlap.
SinkWall2PlayerOverlapBox.jpg
Unfortunately, setting variables within the character BP is causing tons of issues, and the end overlap doesn’t seem to be capable of handling multiple overlapping objects… though I am not sure about this, since the objects I am trying to make sink rarely do so when my box overlaps them. (alot of the time nothing happens). Here are two screens of the issues that arise from setting variables in the player BP:
SinkWall2PlayerStuck1.jpg
SinkWall2PlayerStuck2.jpg
I thought about setting the start and target variables in the construction tab of each wall I want to sink, but I cannot see any way of checking, on overlap, if an object has certain variables or not. Honestly, I’m getting to the end of my rope on this problem because I am not even sure where and what parts are going wrong. If anyone has a solution, or better yet, if a dev has some ideas for how to help, I would love you all forever and ever if you helped me out with this. :smiley:

Sockets and mesh behave quite strange in blueprints. So forget them for now.
Instead make blueprint, add box or sphere as root element. Then add your static mesh (wall cannot be root element if you want it all to work without much vector math).
For actual sinking event use trace from camera to feet location of player (or just player world location with some offset), if it hits your wall BP then sink it. From trace you can also get pointer to blueprint instance that wants to sink.

To smoothly sink wall use interpto from 0 to minus some value on Z axis.

and for sinking:

https://youtube.com/watch?v=VSdxqIBfEAw

Well, the reason that I bother with sockets and such is because I want to be able to tell many different types of walls, with various heights, to sink down to a point where they all have the same amount of mesh still sticking above ground. I have the sockets in place to let my wall know just how far to sink down. (also, my walls are not my root elements). And I want to try and use timelines for sinking because they can be reversed, because I want the wall to raise again when my character is no longer behind it.

bump. Would love it if some weekend warriors could help out by taking a look at my project.