A box collision is in the camera actor bp that runs parallel to the player in this example. And its set to the camera actor, and it is set to block everything.
@ClockworkOcean just so you know, you were correct sir, I have tested with a character bp and got it to work so I will mark your first comment as the answer. But I need you to help me some more for this if you can I would appreciate it. It works but has a few issues. Here is a video with updated results. In the video I have 3 questions for you.
Notice if I press up I go up, but the moment I let go gravity pulls me down although it is off. I want it to just not come down if I press up.
2.@ 14-18 seconds notice the weird nudging effect if I am as far to the right as I can be blocked by a box collision then I press right and it nudges.
3.@ 28 seconds I call this “hole in the box collision”. These are two box collisions, the top and the left. There is no hole or gap there to cause such an effect yet it is happening. And once it gets through there and touches the top of that collision its like my speed is increased to the craft, kind of like when you beat a stage in one of these shipscroller games and the vehicle moves forward at an increased pace until it is off the screen.
Could you not just limit the maximum height, your unit can go. f.e. with a compare node?
You could create a variable with the maximum height, then get your current height, and compare it with max height, and if its equal or higher than max height, set your current height/the position of your character down to the max height.
For your unwanted gravity, if your char has the character movement component, you can switch to flight mode, if you created it from scratch, check everything in your char, if it is affected by gravity, or turn gravity off - which would be almost the same, what the flight mode does.
Yes, like @Suthriel says, this character thing was just checking that was the problem. Once you know it is, you can just limit the movement in the pawn with the code.
I am seeing some promise using this method, when just trying to move up down left or right. Although the diagonals have made things more difficult.
To get the left and right barriers, the only thing I could come up with here is to get the distance to the player character VS the camera actor as the camera actor moves parallel to the player at the same Y speed. So if that distance is greater to or equal a certain number use it to set left or right barrier.
I wondered about this method before but never actually tried to use it. I wonder if I’m trying to limit at the correct places though. My method of movement in this example is add actor world offsets fed by Event Tick.
I don´t know, how you actually move your char, but usually those blocking volumes work and block just fine - if they are set up correctly, and the used movement method is told to respect the block.
F.e. some nodes require you to set a bool to true to start/respect blocking:
But you don´t need them in the sky, if you just limit your max height ^.^ Just follow what @ClockworkOcean says, because (in my eyes) he is a coding god
I read somewhere else that you need to enable sweep to get block to work sometimes.
Ok.
I hear you, both he and Everynone have been a lot of help to me. I hope to one day know just half of what these wizards know about coding and Unreal. And thanks for your help as well!