Download

How to properly move actors and check for 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?

I already have most of this type of movement done: http://youtu.be/EcvFFnoWmwk

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.

I believe you would need to ray trace from your current position to what would be your next position and see see if there’s a collision. If there is, then you should only move up until the point of collision. Though I would just look at how Epic’s flying demo works more carefully.