Alternative to "Move Component to" which takes collisions in to account.
I'm hoping someone can help me. I currently have a destructible mesh blueprint which is set up to move to a random location using the "Move component to" node. The movement looks perfect and is working exactly how I want, however much to my dismay I have discovered that the "Move component to" node doesn't take in to account collisions, so the mesh can freely go through walls.
What is the best alternative to "Move Component to" which will take collisions in to account? Currently the only component in the blueprint is the destructible mesh. I did try adding a box collider to the blueprint and trying the "On component overlap" event to the stop pin of the "Move Component to" not but that didn't work.
asked Jul 14 '16 at 08:50 PM in Blueprint Scripting
You could try tracing from the current location to the random location, and then checking if there was a hit. If yes, move to the hit location. If not, simply move to the random location.
Be sure to store the random location to a variable, so that you don't generate an other one if the trace doesn't hit.
answered Jul 14 '16 at 10:31 PM
Calling SetWorldLocation() on the root component allows you to specify a "sweep" which will stop when it's blocked and return you a list of hit results.
answered Apr 08 '17 at 11:23 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here