The object should move in the direction closest to the wall. Unfortunately it didn’t work. How can I best implement this:
Thanks in advance!
You’re tracing only once, you should trace 4 times. Once in each direction.
Very Nice!
I’ll just add that if the walls are not moving, this can be run once rather than on Tick. No need to waste those precious cycles for trace looping. Depends on what’s needed, ofc.
And if you do not want to use sliding collision the pawn + movement comp offers but still need to stop short of reaching an obstacle, you can either calculate it from actor bounds or look into how Sweep works. That’s providing you do not have collision covered already.
Good luck with rest!