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?
asked Oct 22 '14 at 02:26 AM in Blueprint Scripting
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 ;)
answered Oct 22 '14 at 11:05 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here