How to move actors using local variables and return left, right top and bottom collisions?

Hello. I’m creating a custom movement using values such as X Speed, Y Speed, X Position and Y position. Right now I have line traces running from the root of an object to a set position around it to check for collisions but this can be expensive if there are lots of actors on screen. What I’m trying to figure out is how to move the actor using these variables while returning proper collisions from whatever collision object I’m using and how to prevent it from completely stopping when a sweep is checked on. My other issue is that when turning a sweep off and moving with these values, if the X or Y speed becomes too high, the actor will get stuck in the ground or there will be an incorrect collision return such as the right line trace colliding with the ground, simulating hitting a wall. Is there a proper way to set up actor movement? Right now I have it set as “Set Actor Location” and I plug in the values.

What I ultimately want to do is have one collision object and no line traces running for collision checks. I want to be able to move the actor at any speed I want without it going through walls/floors. I also want to be able to check the specific types of collisions like left, right, top and bottom. Is this possible? Would anyone mind helping me out?

If you use a Character type of Blueprint you have the option to use “Add Movement Input”.

It basically does the same as “Set Actor Location” but you only have to specify a movement vector and it’s speed. The actual difference will be handled by that node. Additionally it already takes collision into consideration. To get the location you can simply get the Hit result and check where the hit location was, check it against your root and you can calculate if it was top, bottom, left or right :wink:

That’s not what I want though because the movement component is limited for the application I want to use it for.

I already have most of this type of movement done:

I just want to tighten up my collisions so that I don’t have limits on the speed I can travel. I noticed in the flying game template, you can pretty much move at an infinite speed and you wont fly through walls. I can’t figure out how to replicate that with multiple variables.